Skip to content

Commit

Permalink
fix(jest problem): with various config guessing gosh... ref below
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchenwei committed Oct 26, 2018
1 parent 1fe0591 commit 79a62df
Show file tree
Hide file tree
Showing 7 changed files with 1,042 additions and 44 deletions.
11 changes: 6 additions & 5 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
"@babel/preset-env",
[
"@vue/app",
{
"useBuiltIns": "entry"
}
}]
]
],
"env": {
"test": {
Expand Down
1,037 changes: 1,012 additions & 25 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
"main": "index.js",
"scripts": {
"build": "webpack --config build/webpack.config.dev.js",
"test": "jest",
"test": "NODE_ENV=test jest",
"dev": "webpack-dev-server --config build/webpack.config.dev.js",
"lint": "eslint --ext .js,.vue src",
"lint:fix": "eslint --ext .js,.vue src --fix",
"setup": "rm -rf ./node_modules/ && npm cache verify && npm install",
"storybook": "start-storybook -p 9001 -c .storybook"
},
"jest": {
"verbose": true,
"moduleFileExtensions": [
"js",
"vue"
Expand All @@ -26,7 +27,7 @@
".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$": "jest-transform-stub"
},
"transformIgnorePatterns": [
"/node_modules/(?!(@storybook/.*\\.vue$))"
"<rootDir>/node_modules/(?!(@storybook/.*\\.vue$))"
],
"snapshotSerializers": [
"<rootDir>/node_modules/jest-serializer-vue"
Expand All @@ -53,10 +54,12 @@
},
"devDependencies": {
"@babel/core": "^7.1.2",
"@babel/preset-env": "^7.1.0",
"@storybook/addon-storyshots": "^3.4.11",
"@storybook/vue": "^4.0.0-alpha.25",
"@vue/babel-preset-app": "^3.0.5",
"@vue/test-utils": "^1.0.0-beta.25",
"babel-core": "^6.26.3",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^23.6.0",
"babel-loader": "^8.0.4",
Expand Down
1 change: 1 addition & 0 deletions src/components/App/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<script>
import HelloComponent from '../HelloComponent/HelloComponent.vue'
export default {
name: 'App',
components: {
HelloComponent
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/HelloComponent/HelloComponent.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
test('HelloComponent', () => {
// const vue = createLocalVue()
// const app = mount(App, { vue })

// expect(app.classes()).toContain('center-content')
// debugger
expect(1).toEqual(1)
})
16 changes: 16 additions & 0 deletions src/components/Initiate.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// import App from '../components/App/App.vue'
import App from '../components/App/App.vue'

// import initStoryshots from '@storybook/addon-storyshots'
// initStoryshots()
console.log(App)
test('INDEX', () => {
debugger
console.log('haha')

// const vue = createLocalVue()
// const app = mount(App, { vue })

// expect(app.classes()).toContain('center-content')
expect(5).toEqual(5)
})
10 changes: 0 additions & 10 deletions src/index.test.js

This file was deleted.

0 comments on commit 79a62df

Please sign in to comment.