eyeglass-dev-testutils
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -15,2 +15,12 @@ "use strict"; | ||
function readFile(path, encoding) { | ||
try { | ||
fs.statSync(path); | ||
return fs.readFileSync(path, encoding); | ||
} | ||
catch (e) { | ||
return ""; | ||
} | ||
} | ||
module.exports = { | ||
@@ -29,4 +39,4 @@ getSassFixtures: function(fixtureDir) { | ||
obj[name] = { | ||
source: fs.readFileSync(sourceFile, encoding), | ||
expected: fs.readFileSync(expectedFile, encoding) | ||
source: readFile(sourceFile, encoding), | ||
expected: readFile(expectedFile, encoding) | ||
}; | ||
@@ -57,3 +67,3 @@ | ||
assert(!result); | ||
this.assertMultilineEqual(err.message, expectedError); | ||
this.assertErrorMessage(err.message, expectedError); | ||
done(); | ||
@@ -115,3 +125,11 @@ }.bind(this)); | ||
}); | ||
}, | ||
assertErrorMessage: function(message, expected) { | ||
if (expected instanceof RegExp) { | ||
assert.ok(expected.test(message)); | ||
} | ||
else { | ||
this.assertMultilineEqual(message, expected); | ||
} | ||
} | ||
}; |
{ | ||
"name": "eyeglass-dev-testutils", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Testing Utilities. For Eyeglass.", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
Sorry, the diff of this file is not supported yet
12394
248