Skip to content

Commit fd3395d

Browse files
committed
More clear test for activation in case of missing HTML file(s) (2).
1 parent c7f84d0 commit fd3395d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/test.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,15 @@ describe('Walder', function () {
3232
async function testActivationWithBadConfigFile(configFileName, textInErrorMessage) {
3333
const configFile = path.resolve(__dirname, configFileName);
3434
const walder = new Walder(configFile);
35+
let error;
3536
try {
3637
await walder.activate();
3738
} catch (e) {
38-
e.should.be.instanceOf(Error);
39-
e.message.should.contain(textInErrorMessage);
40-
return;
39+
error = e;
4140
}
42-
assert.fail("Hasn't thrown");
41+
assert.isDefined(error);
42+
error.should.be.instanceOf(Error);
43+
error.message.should.contain(textInErrorMessage);
4344
}
4445

4546
it('should throw an error when the config file contains missing HTML files in a route', async function () {

0 commit comments

Comments
 (0)