fix(NA): babel 7 polyfill in the tests bundle.

This commit is contained in:
Tiago Costa 2019-03-14 16:58:13 +00:00
parent 1a1d6d16aa
commit 577e165ffa
No known key found for this signature in database
GPG key ID: BAECC2D04A04C6EA
6 changed files with 6 additions and 6 deletions

View file

@ -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') {

View file

@ -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';

View file

@ -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

View file

@ -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\//,

View file

@ -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

View file

@ -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
```