parent
97b2041fa5
commit
5bc6a464d5
@ -1 +1,2 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
|
**/*.spec.*
|
||||||
|
@ -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"
|
"extends": ["plugin:vue-libs/recommended"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"comma-dangle": [2, "always-multiline"],
|
"comma-dangle": [2, "always-multiline"],
|
||||||
"no-var": "error"
|
"no-var": "error"
|
||||||
},
|
},
|
||||||
"globals": {
|
"globals": {
|
||||||
"it": true,
|
"it": true,
|
||||||
"describe": true,
|
"describe": true,
|
||||||
"expect": true
|
"expect": true
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,14 +1,14 @@
|
|||||||
import 'babel-polyfill'
|
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
|
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
|
|
||||||
// require all test files (files that ends with .spec.js)
|
// 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)
|
testsContext.keys().forEach(testsContext)
|
||||||
|
|
||||||
// require all src files except main.js for coverage.
|
// require all src files except main.js for coverage.
|
||||||
// you can also change this to match only the subset of files that
|
// you can also change this to match only the subset of files that
|
||||||
// you want coverage for.
|
// you want coverage for.
|
||||||
const srcContext = require.context('../components', true, /^\.(\.js|\.vue)?$/)
|
const srcContext = require.context(`../components`, true, /^\.(\.js|\.jsx)?$/)
|
||||||
srcContext.keys().forEach(srcContext)
|
srcContext.keys().forEach(srcContext)
|
||||||
|
Loading…
Reference in new issue