Skip to content

Commit

Permalink
Make sure tests actually fail (#25)
Browse files Browse the repository at this point in the history
* Make sure tests actually fail

* Fix mailgun test
  • Loading branch information
timneutkens authored Nov 20, 2018
1 parent 5eeacd0 commit f926990
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 5 additions & 10 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,11 @@ const ncc = require("../");
for (const integrationTest of fs.readdirSync(__dirname + "/integration")) {
it(`should evaluate ${integrationTest} without errors`, async () => {
const code = await ncc(__dirname + "/integration/" + integrationTest);
try {
module.exports = null;
eval(code);
if ("function" !== typeof module.exports) {
throw new Error(`Integration test "${integrationTest}" evaluation failed. It does not export a function`)
}
await module.exports();
} catch (err) {
errored = true;
console.error(`Integration test "${integrationTest}" execution failed`, err);
module.exports = null;
eval(code);
if ("function" !== typeof module.exports) {
throw new Error(`Integration test "${integrationTest}" evaluation failed. It does not export a function`)
}
await module.exports();
})
}
2 changes: 2 additions & 0 deletions test/integration/mailgun.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
const mailgun = require('mailgun');

module.exports = () => {}

0 comments on commit f926990

Please sign in to comment.