From f9269902f2baa8d7a05f87de529ff014032722a0 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Tue, 20 Nov 2018 12:41:00 +0100 Subject: [PATCH] Make sure tests actually fail (#25) * Make sure tests actually fail * Fix mailgun test --- test/index.test.js | 15 +++++---------- test/integration/mailgun.js | 2 ++ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/test/index.test.js b/test/index.test.js index c3504713..0b3487b4 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -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(); }) } diff --git a/test/integration/mailgun.js b/test/integration/mailgun.js index 8c678359..aa24de6b 100644 --- a/test/integration/mailgun.js +++ b/test/integration/mailgun.js @@ -1 +1,3 @@ const mailgun = require('mailgun'); + +module.exports = () => {}