From 590204347d98b94d286cf38dbaf74363e9a786b1 Mon Sep 17 00:00:00 2001 From: jesusbotella Date: Tue, 21 Apr 2020 17:05:20 +0200 Subject: [PATCH] All build and tests working --- babel.config.json | 27 ++++++++++++------- lib/assets/javascripts/.babelrc | 14 ---------- .../test/spec/new-dashboard/unit/.babelrc | 16 ----------- .../test/spec/new-dashboard/unit/jest.conf.js | 13 +++++++-- lib/build/tasks/webpack/webpack.config.js | 2 +- package-lock.json | 22 +++++++++++++++ 6 files changed, 52 insertions(+), 42 deletions(-) delete mode 100644 lib/assets/javascripts/.babelrc delete mode 100644 lib/assets/test/spec/new-dashboard/unit/.babelrc diff --git a/babel.config.json b/babel.config.json index da5730da33..b5e8669101 100644 --- a/babel.config.json +++ b/babel.config.json @@ -1,10 +1,10 @@ { "presets": [ - ["@babel/env", + [ + "@babel/env", { "useBuiltIns": "usage", - "corejs": 3, - "debug": true + "corejs": 3 } ] ], @@ -15,13 +15,22 @@ [ "@babel/plugin-transform-runtime", { - "absoluteRuntime": false, - "corejs": 3, - "helpers": true, - "regenerator": true, - "useESModules": true + "corejs": 3 } ] ], - "sourceType": "unambiguous" + "sourceType": "unambiguous", + "env": { + "test": { + "presets": [ + ["@babel/env"] + ], + "plugins": [ + "@babel/plugin-proposal-object-rest-spread", + "@babel/plugin-transform-classes", + "@babel/plugin-transform-object-assign", + "@babel/plugin-transform-modules-commonjs" + ] + } + } } diff --git a/lib/assets/javascripts/.babelrc b/lib/assets/javascripts/.babelrc deleted file mode 100644 index 587d2d0c2c..0000000000 --- a/lib/assets/javascripts/.babelrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "plugins": [ - [ - "@babel/plugin-transform-runtime", - { - "absoluteRuntime": false, - "corejs": 3, - "helpers": true, - "regenerator": true, - "useESModules": true - } - ] - ] -} diff --git a/lib/assets/test/spec/new-dashboard/unit/.babelrc b/lib/assets/test/spec/new-dashboard/unit/.babelrc deleted file mode 100644 index 793aefef29..0000000000 --- a/lib/assets/test/spec/new-dashboard/unit/.babelrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "presets": [ - [ - "@babel/env", - { - "useBuiltIns": "usage", - "corejs": 3, - "debug": true, - "modules": "commonjs" - } - ] - ], - "plugins": [ - "@babel/plugin-transform-modules-commonjs" - ] -} diff --git a/lib/assets/test/spec/new-dashboard/unit/jest.conf.js b/lib/assets/test/spec/new-dashboard/unit/jest.conf.js index e44d490bb1..a736843a43 100755 --- a/lib/assets/test/spec/new-dashboard/unit/jest.conf.js +++ b/lib/assets/test/spec/new-dashboard/unit/jest.conf.js @@ -3,8 +3,10 @@ const path = require('path'); const srcPath = 'lib/assets/javascripts/'; const testPath = 'lib/assets/test/spec/new-dashboard'; +const rootDir = path.resolve(__dirname, '../../../../../../'); + module.exports = { - rootDir: path.resolve(__dirname, '../../../../../../'), + rootDir, roots: [ `/${testPath}/unit/specs` ], @@ -48,5 +50,12 @@ module.exports = { coverageDirectory: `/${testPath}/coverage`, collectCoverageFrom: [ `${srcPath}/new-dashboard/**/*.{js,vue}` - ] + ], + globals: { + 'vue-jest': { + babelConfig: { + configFile: path.join(rootDir, 'babel.config.json') + } + } + } }; diff --git a/lib/build/tasks/webpack/webpack.config.js b/lib/build/tasks/webpack/webpack.config.js index 415a821252..b686bc1b4b 100644 --- a/lib/build/tasks/webpack/webpack.config.js +++ b/lib/build/tasks/webpack/webpack.config.js @@ -52,7 +52,7 @@ module.exports = { options: { babelrc: false, configFile: false, - presets: [['@babel/env', { debug: true }]], + presets: ['@babel/env'], plugins: ['@babel/plugin-transform-object-assign'] } }, diff --git a/package-lock.json b/package-lock.json index 89d94e7a9c..649579b325 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1560,6 +1560,17 @@ "d3": "3.5.17", "turbo-carto": "^0.21.1", "turf-jenks": "~1.0.1" + }, + "dependencies": { + "carto": { + "version": "github:cartodb/carto#85881d99dd7fcf2c4e16478b04db67108d27a50c", + "from": "github:cartodb/carto#85881d99dd7fcf2c4e16478b04db67108d27a50c", + "requires": { + "mapnik-reference": "~6.0.2", + "optimist": "~0.6.0", + "underscore": "1.8.3" + } + } } } } @@ -11667,6 +11678,17 @@ "d3": "3.5.17", "turbo-carto": "^0.21.1", "turf-jenks": "~1.0.1" + }, + "dependencies": { + "carto": { + "version": "github:cartodb/carto#85881d99dd7fcf2c4e16478b04db67108d27a50c", + "from": "github:cartodb/carto#85881d99dd7fcf2c4e16478b04db67108d27a50c", + "requires": { + "mapnik-reference": "~6.0.2", + "optimist": "~0.6.0", + "underscore": "1.8.3" + } + } } } }