diff --git a/test/core/fixtures/bin/babel-node/require/in-files/foo2.js b/test/core/fixtures/bin/babel-node/require/in-files/foo2.js index 2aa7251446..71db6cd5b2 100644 --- a/test/core/fixtures/bin/babel-node/require/in-files/foo2.js +++ b/test/core/fixtures/bin/babel-node/require/in-files/foo2.js @@ -1,4 +1,5 @@ import "./bar2"; +import "./not_node_modules"; var foo = () => console.log("foo"); foo(); diff --git a/test/core/fixtures/bin/babel-node/require/in-files/not_node_modules.jsx b/test/core/fixtures/bin/babel-node/require/in-files/not_node_modules.jsx new file mode 100644 index 0000000000..f14bae58e1 --- /dev/null +++ b/test/core/fixtures/bin/babel-node/require/in-files/not_node_modules.jsx @@ -0,0 +1,10 @@ +/* +The purpose of this file is to test that the node_modules check in the require +hook doesn't mistakenly exclude something like "not_node_modules". To pass, this +file merely needs to be transpiled. The transpiled code won't, and doesn't need +to, execute without error. It won't execute because React will be undefined. +*/ +try { + ; +} +catch (e) {}