diff --git a/components/popup/index.vue b/components/popup/index.vue index 6aa557ca..10caf5d4 100644 --- a/components/popup/index.vue +++ b/components/popup/index.vue @@ -145,7 +145,7 @@ export default { // popup box enter the animation after popup show this.isPopupBoxShow = true /* istanbul ignore if */ - if (process.env.NODE_ENV === 'test') { + if (process.env.MAND_ENV === 'test') { this.$_onPopupTransitionStart() this.$_onPopupTransitionEnd() } @@ -158,7 +158,7 @@ export default { this.preventScroll && this.$_preventScroll(false) this.$emit('input', false) /* istanbul ignore if */ - if (process.env.NODE_ENV === 'test') { + if (process.env.MAND_ENV === 'test') { this.$_onPopupTransitionStart() this.$_onPopupTransitionEnd() } diff --git a/components/swiper/index.vue b/components/swiper/index.vue index f215d287..3b41b73b 100644 --- a/components/swiper/index.vue +++ b/components/swiper/index.vue @@ -547,8 +547,8 @@ export default { dragState.startTime = new Date() dragState.startLeft = point.pageX dragState.startTop = point.pageY - dragState.itemWidth = process.env.NODE_ENV !== 'test' ? element.offsetWidth : 100 - dragState.itemHeight = process.env.NODE_ENV !== 'test' ? element.offsetHeight : 100 + dragState.itemWidth = process.env.MAND_ENV !== 'test' ? element.offsetWidth : 100 + dragState.itemHeight = process.env.MAND_ENV !== 'test' ? element.offsetHeight : 100 }, $_doOnTouchMove(event) { diff --git a/components/water-mark/index.vue b/components/water-mark/index.vue index 0f94d868..27e15269 100644 --- a/components/water-mark/index.vue +++ b/components/water-mark/index.vue @@ -86,7 +86,7 @@ export default { data() { return { - repetition: process.env.NODE_ENV === 'test' ? 2 : 50, + repetition: process.env.MAND_ENV === 'test' ? 2 : 50, } }, diff --git a/config/dev.env.js b/config/dev.env.js index 1e22973a..fedb8b79 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -3,5 +3,6 @@ const merge = require('webpack-merge') const prodEnv = require('./prod.env') module.exports = merge(prodEnv, { - NODE_ENV: '"development"' + NODE_ENV: '"development"', + MAND_ENV: '"development"', }) diff --git a/config/prod.env.js b/config/prod.env.js index a6f99761..cc4c7b54 100644 --- a/config/prod.env.js +++ b/config/prod.env.js @@ -1,4 +1,5 @@ 'use strict' module.exports = { - NODE_ENV: '"production"' + NODE_ENV: '"production"', + MAND_ENV: '"production"', } diff --git a/config/test.env.js b/config/test.env.js index c2824a30..dded621d 100644 --- a/config/test.env.js +++ b/config/test.env.js @@ -3,5 +3,6 @@ const merge = require('webpack-merge') const devEnv = require('./dev.env') module.exports = merge(devEnv, { - NODE_ENV: '"testing"' + NODE_ENV: '"testing"', + MAND_ENV: '"testing"', }) diff --git a/package.json b/package.json index c892d758..a342b34f 100644 --- a/package.json +++ b/package.json @@ -48,9 +48,9 @@ "build:webpack:mand-mobile": "cross-env NODE_ENV=production node build/webpack/build-mand-mobile", "build:webpack:components": "cross-env NODE_ENV=production gulp build --gulpfile gulpfile.js && node build/webpack/build-style-entry", "codecov": "codecov", - "test": "jest --no-cache --runInBand --verbose --silent", - "test:lib": "TEST_TYPE=lib jest --no-cache --runInBand --verbose --silent", - "test:lib-vw": "TEST_TYPE=lib-vw jest --no-cache --runInBand --verbose --silent" + "test": "MAND_ENV=test jest --no-cache --runInBand --verbose --silent", + "test:lib": "MAND_ENV=test TEST_TYPE=lib jest --no-cache --runInBand --verbose --silent", + "test:lib-vw": "MAND_ENV=test TEST_TYPE=lib-vw jest --no-cache --runInBand --verbose --silent" }, "license": "Apache", "config": {