From 3c2269f01daa025231ca76c5762eeb2df7cf1353 Mon Sep 17 00:00:00 2001 From: Nakamura Takahiro Date: Tue, 10 Oct 2017 19:39:43 +0900 Subject: [PATCH] add/fix setting to run vue component test - enable module plugin of babel see: https://github.com/facebook/jest/issues/3202 - fix path to vue mapper --- .babelrc | 23 +++++++++++++++-------- package.json | 2 +- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.babelrc b/.babelrc index ded31c0..0a44cdc 100644 --- a/.babelrc +++ b/.babelrc @@ -1,13 +1,20 @@ { "presets": [ - ["env", { - "modules": false, - "targets": { - "browsers": "> 1%", - "uglify": true - }, - "useBuiltIns": true - }] + [ + "env", { + "test": { + "useBuiltIns": true + }, + "development": { + "modules": false, + "targets": { + "browsers": "> 1%", + "uglify": true + }, + "useBuiltIns": true + } + } + ] ], "plugins": [ diff --git a/package.json b/package.json index e53d5b1..52dc786 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "roots": ["/app/javascript/packs"], "moduleDirectories": ["/node_modules"], "moduleNameMapper": { - "^vue$": "/node_modules/vue/dist/vue.common.js" + "^vue$": "vue/dist/vue.common.js" }, "moduleFileExtensions": [ "js",