-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
346a97c
commit e7020d0
Showing
5 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"per-file": true, | ||
"lines": 25, | ||
"statements": 25, | ||
"functions": 10, | ||
"branches": 35, | ||
"check-coverage": true, | ||
"include": ["src/**/*.vue", "src/**/*.js"], | ||
"exclude": ["node_modules"], | ||
"extension": [".js", ".vue"], | ||
"reporter": [ | ||
"lcov", | ||
"text" | ||
], | ||
"cache": true, | ||
"all": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default { | ||
require: ['./test/helpers/register.js', './test/helpers/setup.js'], | ||
sources: ['**/*.{js,vue}'], | ||
snapshotDir: './test/snapshot', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require('@babel/register')({ | ||
// These patterns are relative to the project directory (where the `package.json` file lives): | ||
ignore: ['node_modules/*', 'test/*'], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const hooks = require('require-extension-hooks'); | ||
|
||
if (process.env.TEST === 'unit') { | ||
require('jsdom-global')(); | ||
require('browser-env'); | ||
const Vue = require('vue'); | ||
Vue.config.productionTip = false; | ||
// https://github.com/nuxt/create-nuxt-app/issues/180#issuecomment-463069941 | ||
window.Date = global.Date = Date; | ||
} | ||
|
||
if (process.env.TEST === 'e2e') { | ||
const Vue = require('vue'); | ||
Vue.config.productionTip = false; | ||
} | ||
|
||
// Setup vue files to be processed by `require-extension-hooks-vue` | ||
hooks('vue') | ||
.plugin('vue') | ||
.push(); | ||
// Setup vue and js files to be processed by `require-extension-hooks-babel` | ||
hooks(['vue', 'js']) | ||
.exclude(({ filename }) => filename.match(/\/node_modules\//)) | ||
.plugin('babel') | ||
.push(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { mount, createLocalVue } from '@vue/test-utils'; | ||
import test from 'ava'; | ||
import VClappr from '@/VClappr.vue'; | ||
|
||
let wrapper; | ||
const localVue = createLocalVue(); | ||
|
||
test.beforeEach(() => { | ||
wrapper = mount(VClappr, { | ||
localVue, | ||
}); | ||
}); | ||
|
||
test('is a Vue instance', t => { | ||
t.is(wrapper.isVueInstance(), true); | ||
}); | ||
|
||
test('is the form buttons are clickable', t => { | ||
t.is(wrapper.vm.$data.formSubmit, false); | ||
}); | ||
|
||
test('renders correct snapshot', t => { | ||
t.snapshot(wrapper.vm.$el.outerHTML); | ||
}); |