Skip to content

Commit bfebc6d

Browse files
author
Guillaume Chau
committed
fix(ui): tests
1 parent cd88b47 commit bfebc6d

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

packages/@vue/cli-ui/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
"lint": "vue-cli-service lint",
88
"graphql-api": "cross-env VUE_CLI_DEBUG=true VUE_CLI_UI_DEV=true vue-cli-service graphql-api",
99
"run-graphql-api": "vue-cli-service run-graphql-api",
10-
"run-test-graphql-api": "cross-env NODE_ENV=test VUE_APP_GRAPHQL_PORT=4040 VUE_APP_CLI_UI_URL=ws://localhost:4040/graphql yarn run graphql-api",
10+
"test-graphql-api": "cross-env VUE_CLI_UI_TEST=true VUE_APP_GRAPHQL_PORT=4040 VUE_APP_CLI_UI_URL=ws://localhost:4040/graphql yarn run graphql-api",
1111
"prepublishOnly": "yarn run lint --no-fix && yarn run build",
1212
"test:e2e:dev": "cross-env VUE_APP_CLI_UI_URL=ws://localhost:4040/graphql vue-cli-service test:e2e --mode development",
1313
"test:e2e:run": "vue-cli-service test:e2e --mode production --headless --url=http://localhost:4040",
14-
"test:e2e": "start-server-and-test run-test-graphql-api http://localhost:4040 test:e2e:dev",
15-
"test:run": "start-server-and-test run-test-graphql-api http://localhost:4040 test:e2e:run",
14+
"test:e2e": "yarn run test:clear && start-server-and-test test-graphql-api http://localhost:4040 test:e2e:dev",
15+
"test:run": "yarn run test:clear && start-server-and-test test-graphql-api http://localhost:4040 test:e2e:run",
16+
"test:clear": "rimraf ../../test/cli-ui-test && rimraf ./live-test",
1617
"test": "yarn run build && cd ../cli-ui-addon-webpack && yarn run build && cd ../cli-ui && yarn run test:run"
1718
},
1819
"dependencies": {
@@ -56,6 +57,7 @@
5657
"file-icons-js": "^1.0.3",
5758
"lint-staged": "^6.0.0",
5859
"portal-vue": "^1.3.0",
60+
"rimraf": "^2.6.2",
5961
"start-server-and-test": "^1.4.1",
6062
"stylus": "^0.54.5",
6163
"stylus-loader": "^3.0.1",

packages/@vue/cli-ui/src/graphql-api/utils/db.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { resolve } = require('path')
55

66
let folder = '../../../live'
77

8-
if (process.env.NODE_ENV === 'test') {
8+
if (process.env.VUE_CLI_UI_TEST) {
99
folder = '../../../live-test'
1010
// Clean DB
1111
fs.removeSync(resolve(__dirname, folder))

packages/@vue/cli-ui/vue-cli-ui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file will be loaded when the project is opened
22
module.exports = api => {
3-
if (process.env.NODE_ENV === 'production') return
3+
if (!process.env.VUE_CLI_UI_DEV) return
44

55
// Add dynamic components in dev mode (webpack dashboard & analyzer)
66
api.addClientAddon({

0 commit comments

Comments
 (0)