Skip to content

Commit 3573896

Browse files
committed
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.
1 parent 767c3f8 commit 3573896

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

test/cli.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,13 @@ test('improper use of t.throws from within an async callback will be reported to
129129
});
130130
});
131131

132-
test('babel require hook only applies to the test file', t => {
132+
test('babel require hook only does not apply to source files', t => {
133133
t.plan(3);
134134

135135
execCli('fixture/babel-hook.js', (err, stdout, stderr) => {
136136
t.ok(err);
137137
t.is(err.code, 1);
138-
t.match(stderr, /Unexpected token/);
138+
t.match(stderr, /Unexpected (token|reserved word)/);
139139
t.end();
140140
});
141141
});

test/fixture/babel-hook-imported.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.export = async () => {};
1+
export default () => {};

0 commit comments

Comments
 (0)