tjz
7 years ago
7 changed files with 75 additions and 65 deletions
@ -0,0 +1,14 @@
|
||||
import Vue from 'vue' |
||||
import Button from '../index' |
||||
|
||||
describe('Button.vue', () => { |
||||
it('should render correct contents', () => { |
||||
const Constructor = Vue.extend(Button) |
||||
const ele = document.createElement('div') |
||||
document.body.appendChild(ele) |
||||
const vm = new Constructor({ propsData: { type: 'primary' }}) |
||||
vm.$mount(ele) |
||||
expect(vm.$el.classList.contains('ant-btn-primary')) |
||||
.to.equal(true) |
||||
}) |
||||
}) |
@ -1,12 +1,12 @@
|
||||
{ |
||||
"extends": ["plugin:vue-libs/recommended"], // ,"plugin:vue-libs/recommended" |
||||
"rules": { |
||||
"comma-dangle": [2, "always-multiline"], |
||||
"no-var": "error" |
||||
}, |
||||
"globals": { |
||||
"it": true, |
||||
"describe": true, |
||||
"expect": true |
||||
} |
||||
} |
||||
"extends": ["plugin:vue-libs/recommended"], |
||||
"rules": { |
||||
"comma-dangle": [2, "always-multiline"], |
||||
"no-var": "error" |
||||
}, |
||||
"globals": { |
||||
"it": true, |
||||
"describe": true, |
||||
"expect": true |
||||
} |
||||
} |
@ -1,14 +1,14 @@
|
||||
import 'babel-polyfill' |
||||
|
||||
import Vue from 'vue' |
||||
|
||||
Vue.config.productionTip = false |
||||
|
||||
// require all test files (files that ends with .spec.js)
|
||||
const testsContext = require.context('./specs', true, /\.spec$/) |
||||
const testsContext = require.context(`../components/${process.env.SCOPE}`, true, /\.spec$/) |
||||
testsContext.keys().forEach(testsContext) |
||||
|
||||
// require all src files except main.js for coverage.
|
||||
// you can also change this to match only the subset of files that
|
||||
// you want coverage for.
|
||||
const srcContext = require.context('../components', true, /^\.(\.js|\.vue)?$/) |
||||
const srcContext = require.context(`../components`, true, /^\.(\.js|\.jsx)?$/) |
||||
srcContext.keys().forEach(srcContext) |
||||
|
Loading…
Reference in new issue