mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
parent
13d6935b1a
commit
fab9682e9a
@ -24,7 +24,7 @@
|
|||||||
"clean": "rimraf lib && rimraf packages/*/lib",
|
"clean": "rimraf lib && rimraf packages/*/lib",
|
||||||
"lint": "felint lint src/**/*.js packages/**/*.{js,vue} build/**/*.js",
|
"lint": "felint lint src/**/*.js packages/**/*.{js,vue} build/**/*.js",
|
||||||
"test": "karma start test/unit/karma.conf.js --single-run",
|
"test": "karma start test/unit/karma.conf.js --single-run",
|
||||||
"test:coverage": "find test/unit/coverage/lcov-report -name 'index.html' | sed -n 1,1p | xargs -I {} open {} ",
|
"test:coverage": "open test/unit/coverage/lcov-report/index.html",
|
||||||
"test:watch": "karma start test/unit/karma.conf.js",
|
"test:watch": "karma start test/unit/karma.conf.js",
|
||||||
"release": "npm run bootstrap && sh build/release.sh"
|
"release": "npm run bootstrap && sh build/release.sh"
|
||||||
},
|
},
|
||||||
|
@ -47,7 +47,7 @@ const webpackConfig = {
|
|||||||
{
|
{
|
||||||
enforce: 'pre',
|
enforce: 'pre',
|
||||||
test: /\.js$/,
|
test: /\.js$/,
|
||||||
exclude: /node_modules|vue-router\/|vue-loader\/|vue-hot-reload-api\/|docs|test|src\/index|packages\/swipe/,
|
exclude: /node_modules|vue-router\/|vue-loader\/|vue-hot-reload-api\/|docs|test|src\/index|src\/utils|src\/mixins|packages\/swipe/,
|
||||||
use: ['isparta-loader']
|
use: ['isparta-loader']
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
import { hasClass, addClass, removeClass } from 'src/utils/dom';
|
|
||||||
|
|
||||||
describe('Utils Dom', () => {
|
|
||||||
let wrapper;
|
|
||||||
beforeEach(() => {
|
|
||||||
wrapper = document.createElement('div');
|
|
||||||
wrapper.classList.add('test-class');
|
|
||||||
document.body.appendChild(wrapper);
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
document.body.removeChild(wrapper);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('hasClass', () => {
|
|
||||||
expect(hasClass(wrapper, 'test-class')).to.be.true;
|
|
||||||
expect(hasClass()).to.be.false;
|
|
||||||
});
|
|
||||||
|
|
||||||
it('addClass and removeClass', () => {
|
|
||||||
expect(hasClass(wrapper, 'test-class')).to.be.true;
|
|
||||||
|
|
||||||
addClass(wrapper, ' other-class');
|
|
||||||
expect(hasClass(wrapper, 'other-class')).to.be.true;
|
|
||||||
expect(addClass()).to.equal(undefined);
|
|
||||||
|
|
||||||
removeClass(wrapper, ' other-class');
|
|
||||||
expect(hasClass(wrapper, 'other-class')).to.be.false;
|
|
||||||
expect(removeClass()).to.equal(undefined);
|
|
||||||
});
|
|
||||||
});
|
|
Loading…
x
Reference in New Issue
Block a user