mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
fix(NA): babel 7 polyfill in the tests bundle.
This commit is contained in:
parent
1a1d6d16aa
commit
577e165ffa
6 changed files with 6 additions and 6 deletions
|
@ -25,7 +25,7 @@ function babelRegister() {
|
|||
const plugin = pluginConfig();
|
||||
|
||||
try {
|
||||
// add support for moved babel-register source: https://github.com/elastic/kibana/pull/13973
|
||||
// add support for moved @babel/register source: https://github.com/elastic/kibana/pull/13973
|
||||
require(resolve(plugin.kibanaRoot, 'src/setup_node_env/babel_register')); // eslint-disable-line import/no-dynamic-require
|
||||
} catch (error) {
|
||||
if (error.code === 'MODULE_NOT_FOUND') {
|
||||
|
|
|
@ -30,7 +30,7 @@ export const createTestEntryTemplate = (defaultUiSettings) => (bundle) => `
|
|||
*/
|
||||
|
||||
// import global polyfills before everything else
|
||||
import 'babel-polyfill';
|
||||
import '@babel/polyfill';
|
||||
import 'custom-event-polyfill';
|
||||
import 'whatwg-fetch';
|
||||
import 'abortcontroller-polyfill';
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
// statement into a list of import statements based on the polyfills
|
||||
// necessary for our target environment (the current version of node)
|
||||
// but since it does that during compilation, `import '@babel/polyfill'`
|
||||
// must be in a file that is loaded with `require()` AFTER `babel-register`
|
||||
// must be in a file that is loaded with `require()` AFTER `@babel/register`
|
||||
// is configured.
|
||||
//
|
||||
// This is why we have this single statement in it's own file and require
|
||||
|
|
|
@ -25,7 +25,7 @@ if (!process.env.BABEL_CACHE_PATH) {
|
|||
process.env.BABEL_CACHE_PATH = resolve(__dirname, '../../../optimize/.babelcache.json');
|
||||
}
|
||||
|
||||
// paths that babel-register should ignore
|
||||
// paths that @babel/register should ignore
|
||||
var ignore = [
|
||||
/\/bower_components\//,
|
||||
/\/kbn-pm\/dist\//,
|
||||
|
|
|
@ -32,7 +32,7 @@ Drawer.
|
|||
Add a `debugger` line to create a breakpoint, and then:
|
||||
|
||||
```
|
||||
gulp sync && mocha debug --compilers js:babel-register /pathto/kibana/plugins/monitoring/pathto/__tests__/testfile.js
|
||||
gulp sync && mocha debug --compilers js:@babel/register /pathto/kibana/plugins/monitoring/pathto/__tests__/testfile.js
|
||||
```
|
||||
|
||||
## Multicluster Setup for Development
|
||||
|
|
|
@ -19,7 +19,7 @@ If you have installed this somewhere other than via x-plugins, and next to the k
|
|||
To run the server tests, change into `x-plugins/kibana` and run:
|
||||
|
||||
```bash
|
||||
mocha --debug --compilers js:babel/register plugins/profiler/**/__tests__/**/*.js
|
||||
mocha --debug --compilers js:@babel/register plugins/profiler/**/__tests__/**/*.js
|
||||
```
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue