Skip to content

Commit 9669abb

Browse files
committed
test: run tests on final build
1 parent dc3bdd2 commit 9669abb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+109
-128
lines changed

build/webpack.test.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ module.exports = {
2323
resolve: {
2424
alias: {
2525
'~src': `${projectRoot}/src`,
26-
'~resources': `${projectRoot}/test/resources`
26+
'~resources': `${projectRoot}/test/resources`,
27+
'~vue-test-utils': `${projectRoot}/dist/vue-test-utils`
2728
}
2829
},
2930
output: {

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
],
1111
"scripts": {
1212
"build": "node build/build.js",
13+
"build:test": "NODE_ENV=test node build/build.js",
1314
"docs": "cd docs && gitbook install && gitbook serve",
1415
"docs:deploy": "build/update-docs.sh",
1516
"docs:serve": "cd docs && gitbook serve",
@@ -20,8 +21,8 @@
2021
"setup": "node build/install-hooks.js",
2122
"test": "npm run lint && npm run lint:docs && npm run flow && npm run test:types && npm run test:unit && npm run test:unit:karma",
2223
"test:compatibility": "test/test.sh",
23-
"test:unit": "mocha-webpack --webpack-config build/webpack.test.config.js test/unit/specs --recursive --require test/unit/setup/mocha.setup.js",
24-
"test:unit:karma": "cross-env BABEL_ENV=test TARGET=browser karma start test/unit/setup/karma.conf.js --single-run",
24+
"test:unit": "npm run build:test && mocha-webpack --webpack-config build/webpack.test.config.js test/unit/specs --recursive --require test/unit/setup/mocha.setup.js",
25+
"test:unit:karma": "npm run build:test && cross-env BABEL_ENV=test TARGET=browser karma start test/unit/setup/karma.conf.js --single-run",
2526
"test:types": "tsc -p types",
2627
"release": "bash build/release.sh",
2728
"release:note": "node build/gen-release-note.js"

test/unit/specs/TransitionGroupStub.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import ComponentWithTransitionGroup from '~resources/components/component-with-transition-group.vue'
22
import TransitionGroupStub from '~src/components/TransitionGroupStub'
3-
import mount from '~src/mount'
3+
import { mount } from '~vue-test-utils'
44

55
describe('TransitionGroupStub', () => {
66
it('update synchronously when used as stubs for Transition', () => {

test/unit/specs/TransitionStub.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import ComponentWithTransition from '~resources/components/component-with-transition.vue'
22
import TransitionStub from '~src/components/TransitionStub'
3-
import mount from '~src/mount'
3+
import { mount } from '~vue-test-utils'
44

55
describe('TransitionStub', () => {
66
it('update synchronously when used as stubs for Transition', () => {

test/unit/specs/config.spec.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import mount from '~src/mount'
2-
import TransitionStub from '~src/components/TransitionStub'
3-
import TransitionGroupStub from '~src/components/TransitionGroupStub'
4-
import config from '~src/config'
1+
import {
2+
mount,
3+
config,
4+
TransitionStub,
5+
TransitionGroupStub
6+
} from '~vue-test-utils'
57

68
describe('config', () => {
79
beforeEach(() => {

test/unit/specs/create-local-vue.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import createLocalVue from '~src/create-local-vue'
1+
import { createLocalVue } from '~vue-test-utils'
22
import Vuex from 'vuex'
33
import Vuetify from 'vuetify'
44
import VueRouter from 'vue-router'
5-
import mount from '~src/mount'
5+
import { mount } from '~vue-test-utils'
66
import Component from '~resources/components/component.vue'
77
import ComponentWithVuex from '~resources/components/component-with-vuex.vue'
88
import ComponentWithRouter from '~resources/components/component-with-router.vue'

test/unit/specs/mount.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import Vue from 'vue'
22
import { compileToFunctions } from 'vue-template-compiler'
3-
import mount from '~src/mount'
3+
import { mount } from '~vue-test-utils'
44
import Component from '~resources/components/component.vue'
55
import ComponentWithProps from '~resources/components/component-with-props.vue'
66
import ComponentWithMixin from '~resources/components/component-with-mixin.vue'
7-
import createLocalVue from '~src/create-local-vue'
7+
import { createLocalVue } from '~vue-test-utils'
88
import { injectSupported, vueVersion } from '~resources/test-utils'
99

1010
describe('mount', () => {

test/unit/specs/mount/Wrapper/at.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { compileToFunctions } from 'vue-template-compiler'
2-
import mount from '~src/mount'
2+
import { mount } from '~vue-test-utils'
33

44
describe('at', () => {
55
it('throws an error', () => {

test/unit/specs/mount/Wrapper/attributes.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { compileToFunctions } from 'vue-template-compiler'
2-
import mount from '~src/mount'
2+
import { mount } from '~vue-test-utils'
33

44
describe('attributes', () => {
55
it('returns true if wrapper contains attribute matching value', () => {

test/unit/specs/mount/Wrapper/classes.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import { compileToFunctions } from 'vue-template-compiler'
3-
import mount from '~src/mount'
3+
import { mount } from '~vue-test-utils'
44
import ComponentWithCssModules from '~resources/components/component-with-css-modules.vue'
55

66
describe('classes', () => {

0 commit comments

Comments
 (0)