Skip to content

Commit

Permalink
[babel-register] use regex that does not ignore test files
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Nov 22, 2018
1 parent b72b7da commit e485416
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/setup_node_env/babel_register/register.js
Expand Up @@ -57,7 +57,11 @@ if (global.__BUILT_WITH_BABEL__) {
// TODO: the plugin install process could transpile plugin server code...
ignore.push(resolve(__dirname, '../../../src'));
} else {
ignore.push(resolve(__dirname, '../../../packages'));
ignore.push(
// ignore any path in the packages, unless it is a file in a test,
// or __tests__ directory, or it ends with .test.js, .test.ts, or .test.tsx
/\/packages\/(eslint-|kbn-)[^\/]+\/(?!(.+\/)?(test|__tests__)\/.+|.+\.test\.(js|ts|tsx)$)(.+$)/
);
}

// modifies all future calls to require() to automatically
Expand Down

0 comments on commit e485416

Please sign in to comment.