From 8309653eddff359aae24276ec04ddf47873549fd Mon Sep 17 00:00:00 2001 From: Mark Wubben Date: Thu, 23 Feb 2017 11:46:22 +0000 Subject: [PATCH] Fix Babel require hook test for Node.js 7.6.0 Node.js 7.6.0 supports async / await so the test doesn't throw an exception. Use the unsupported module syntax instead. --- test/cli.js | 4 ++-- test/fixture/babel-hook-imported.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/cli.js b/test/cli.js index abbf6e841..32993d11e 100644 --- a/test/cli.js +++ b/test/cli.js @@ -129,13 +129,13 @@ test('improper use of t.throws from within an async callback will be reported to }); }); -test('babel require hook only applies to the test file', t => { +test('babel require hook only does not apply to source files', t => { t.plan(3); execCli('fixture/babel-hook.js', (err, stdout, stderr) => { t.ok(err); t.is(err.code, 1); - t.match(stderr, /Unexpected token/); + t.match(stderr, /Unexpected (token|reserved word)/); t.end(); }); }); diff --git a/test/fixture/babel-hook-imported.js b/test/fixture/babel-hook-imported.js index 121e27f6a..2d1ec2382 100644 --- a/test/fixture/babel-hook-imported.js +++ b/test/fixture/babel-hook-imported.js @@ -1 +1 @@ -module.export = async () => {}; +export default () => {};