Skip to content

Commit 463bdb2

Browse files
committed
switch to mocha/sinon/chai
1 parent e562f67 commit 463bdb2

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "vue-cli-template-webpack",
3+
"version": "1.0.0",
4+
"license": "MIT",
5+
"description": "A full-featured Webpack setup with hot-reload, lint-on-save, unit testing & css extraction.",
6+
"scripts": {
7+
"docs": "cd docs && gitbook serve",
8+
"deploy-docs": "bash ./deploy-docs.sh"
9+
}
10+
}

template/package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"babel-plugin-transform-runtime": "^6.0.0",
2424
"babel-preset-es2015": "^6.0.0",
2525
"babel-preset-stage-2": "^6.0.0",
26+
"chai": "^3.5.0",
2627
"chromedriver": "^2.21.2",
2728
"connect-history-api-fallback": "^1.1.0",
2829
"cross-spawn": "^2.1.5",
@@ -43,20 +44,24 @@
4344
"http-proxy-middleware": "^0.12.0",
4445
"inject-loader": "^2.0.1",
4546
"isparta-loader": "^2.0.0",
46-
"jasmine-core": "^2.4.1",
4747
"json-loader": "^0.5.4",
4848
"karma": "^0.13.15",
4949
"karma-coverage": "^0.5.5",
50-
"karma-jasmine": "^0.3.6",
50+
"karma-mocha": "^0.2.2",
5151
"karma-phantomjs-launcher": "^1.0.0",
52+
"karma-sinon-chai": "^1.2.0",
5253
"karma-sourcemap-loader": "^0.3.7",
5354
"karma-spec-reporter": "0.0.24",
5455
"karma-webpack": "^1.7.0",
56+
"lolex": "^1.4.0",
57+
"mocha": "^2.4.5",
5558
"nightwatch": "^0.8.18",
5659
"ora": "^0.2.0",
5760
"phantomjs-prebuilt": "^2.1.3",
5861
"selenium-server": "2.53.0",
5962
"shelljs": "^0.6.0",
63+
"sinon": "^1.17.3",
64+
"sinon-chai": "^2.8.0",
6065
"url-loader": "^0.5.7",
6166
"vue-hot-reload-api": "^1.2.0",
6267
"vue-html-loader": "^1.0.0",

template/test/unit/karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module.exports = function (config) {
4444
// http://karma-runner.github.io/0.13/config/browsers.html
4545
// 2. add it to the `browsers` array below.
4646
browsers: ['PhantomJS'],
47-
frameworks: ['jasmine'],
47+
frameworks: ['mocha', 'sinon-chai'],
4848
reporters: ['spec', 'coverage'],
4949
files: ['./index.js'],
5050
preprocessors: {

template/test/unit/specs/Hello.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe('Hello.vue', () => {
77
template: '<div><hello></hello></div>',
88
components: { Hello }
99
}).$mount()
10-
expect(vm.$el.querySelector('.hello h1').textContent).toBe('Hello World!')
10+
expect(vm.$el.querySelector('.hello h1').textContent).to.contain('Hello World!')
1111
})
1212
})
1313

0 commit comments

Comments
 (0)