Skip to content

Commit

Permalink
fix(ui): tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Jun 4, 2018
1 parent cd88b47 commit bfebc6d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions packages/@vue/cli-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
"lint": "vue-cli-service lint",
"graphql-api": "cross-env VUE_CLI_DEBUG=true VUE_CLI_UI_DEV=true vue-cli-service graphql-api",
"run-graphql-api": "vue-cli-service run-graphql-api",
"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",
"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",
"prepublishOnly": "yarn run lint --no-fix && yarn run build",
"test:e2e:dev": "cross-env VUE_APP_CLI_UI_URL=ws://localhost:4040/graphql vue-cli-service test:e2e --mode development",
"test:e2e:run": "vue-cli-service test:e2e --mode production --headless --url=http://localhost:4040",
"test:e2e": "start-server-and-test run-test-graphql-api http://localhost:4040 test:e2e:dev",
"test:run": "start-server-and-test run-test-graphql-api http://localhost:4040 test:e2e:run",
"test:e2e": "yarn run test:clear && start-server-and-test test-graphql-api http://localhost:4040 test:e2e:dev",
"test:run": "yarn run test:clear && start-server-and-test test-graphql-api http://localhost:4040 test:e2e:run",
"test:clear": "rimraf ../../test/cli-ui-test && rimraf ./live-test",
"test": "yarn run build && cd ../cli-ui-addon-webpack && yarn run build && cd ../cli-ui && yarn run test:run"
},
"dependencies": {
Expand Down Expand Up @@ -56,6 +57,7 @@
"file-icons-js": "^1.0.3",
"lint-staged": "^6.0.0",
"portal-vue": "^1.3.0",
"rimraf": "^2.6.2",
"start-server-and-test": "^1.4.1",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-ui/src/graphql-api/utils/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { resolve } = require('path')

let folder = '../../../live'

if (process.env.NODE_ENV === 'test') {
if (process.env.VUE_CLI_UI_TEST) {
folder = '../../../live-test'
// Clean DB
fs.removeSync(resolve(__dirname, folder))
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-ui/vue-cli-ui.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file will be loaded when the project is opened
module.exports = api => {
if (process.env.NODE_ENV === 'production') return
if (!process.env.VUE_CLI_UI_DEV) return

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

0 comments on commit bfebc6d

Please sign in to comment.