Skip to content
This repository was archived by the owner on Jul 7, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
"scripts": {
"dev": "webpack-dev-server --progress --config build/webpack.dev.conf.js",
"start": "NODE_ENV=development npm run dev",
"test": "npm run unit",
"test": "vue-cli-service test:unit",
"lint": "eslint --ext .js,.vue src test/unit/specs",
"build": "node build/build.js"
},
"dependencies": {
"@vue/cli-plugin-unit-jest": "^3.2.0",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be devDependencies?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I thought, but for some reason the vue cli put this in dependencies (and I followed their lead). I could probably change it, I just wanted to get this fix out quickly since the issue was stale.

"@vue/cli-service": "^3.2.0",
"@vue/test-utils": "^1.0.0-beta.27",
"aws-amplify": "^1.1.4",
"aws-amplify-vue": "^0.1.1",
"aws-sdk": "^2.209.0",
Expand Down Expand Up @@ -72,5 +75,28 @@
"> 1%",
"last 2 versions",
"not ie <= 8"
]
],
"jest": {
"moduleFileExtensions": [
"js",
"jsx",
"json",
"vue"
],
"transform": {
"^.+\\.vue$": "vue-jest",
".+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$": "jest-transform-stub",
"^.+\\.jsx?$": "babel-jest"
},
"moduleNameMapper": {
"^@/(.*)$": "<rootDir>/src/$1"
},
"snapshotSerializers": [
"jest-serializer-vue"
],
"testMatch": [
"**/test/unit/**/*.spec.(js|jsx|ts|tsx)"
],
"testURL": "http://localhost/"
}
}
11 changes: 0 additions & 11 deletions test/unit/specs/HelloWorld.spec.js

This file was deleted.

17 changes: 17 additions & 0 deletions test/unit/specs/Home.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Vue from 'vue';
import { mount } from '@vue/test-utils'
import Home from '@/components/Home.vue'

describe('Home.vue', () => {
let wrapper;
let vm;
beforeAll(() => {
wrapper = mount(Home)
vm = wrapper.vm
})
it('should render correct header', () => {
expect(wrapper.html()).toContain(`<h1 class="h1">
AWS Amplify Vue Sample
</h1>`)
})
})