Update test infrastructure

This commit is contained in:
Pig Fang 2018-07-31 22:58:35 +08:00
parent 72946e2474
commit 379ddd5251
4 changed files with 16 additions and 5 deletions

View File

@ -23,6 +23,9 @@
"targets": { "node": "current" },
"ignoreBrowserslistConfig": true
}]
],
"plugins": [
"dynamic-import-node"
]
}
}

View File

@ -53,6 +53,7 @@
"babel-eslint": "^8.2.6",
"babel-jest": "^23.4.2",
"babel-loader": "^8.0.0-beta.4",
"babel-plugin-dynamic-import-node": "^2.0.0",
"codecov": "^3.0.0",
"copy-webpack-plugin": "^4.5.2",
"css-loader": "^1.0.0",
@ -80,6 +81,7 @@
"yaml-loader": "^0.5.0"
},
"jest": {
"resetMocks": true,
"transform": {
"^.+\\.js$": "babel-jest",
".*\\.vue$": "vue-jest"

View File

@ -15,11 +15,6 @@ function factory(opt = {}) {
};
}
beforeEach(() => {
axios.post.mockReset();
swal.mockReset();
});
test('computed values', () => {
const wrapper = mount(ClosetItem, { propsData: factory() });
expect(wrapper.find('img').attributes().src).toBe('/preview/1.png');

View File

@ -1259,6 +1259,13 @@ babel-messages@^6.23.0:
dependencies:
babel-runtime "^6.22.0"
babel-plugin-dynamic-import-node@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.0.0.tgz#d6fc3f6c5e3bdc34e49c15faca7ce069755c0a57"
dependencies:
babel-plugin-syntax-dynamic-import "^6.18.0"
object.assign "^4.1.0"
babel-plugin-istanbul@^4.1.6:
version "4.1.6"
resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz#36c59b2192efce81c5b378321b74175add1c9a45"
@ -1272,6 +1279,10 @@ babel-plugin-jest-hoist@^23.2.0:
version "23.2.0"
resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.2.0.tgz#e61fae05a1ca8801aadee57a6d66b8cefaf44167"
babel-plugin-syntax-dynamic-import@^6.18.0:
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz#8d6a26229c83745a9982a441051572caa179b1da"
babel-plugin-syntax-object-rest-spread@^6.13.0:
version "6.13.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5"