Skip to content
This repository was archived by the owner on Apr 9, 2022. It is now read-only.

Commit ce242d5

Browse files
committed
fix unit tests
1 parent 3c62e87 commit ce242d5

File tree

5 files changed

+31
-12
lines changed

5 files changed

+31
-12
lines changed

client/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"babel-plugin-syntax-jsx": "^6.18.0",
3030
"babel-plugin-transform-runtime": "^6.22.0",
3131
"babel-plugin-transform-vue-jsx": "^3.5.0",
32+
"babel-polyfill": "^6.26.0",
3233
"babel-preset-env": "^1.3.2",
3334
"babel-preset-stage-2": "^6.22.0",
3435
"babel-register": "^6.22.0",

client/test/unit/karma.conf.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ module.exports = function (config) {
1414
browsers: ['PhantomJS'],
1515
frameworks: ['mocha', 'sinon-chai', 'phantomjs-shim'],
1616
reporters: ['spec', 'coverage'],
17-
files: ['./index.js'],
17+
files: [
18+
'../../node_modules/babel-polyfill/dist/polyfill.js',
19+
'./index.js'
20+
],
1821
preprocessors: {
1922
'./index.js': ['webpack', 'sourcemap']
2023
},

client/test/unit/specs/HelloWorld.spec.js

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import Vue from 'vue';
2+
import Router from 'vue-router';
3+
4+
import Login from '@/views/Login';
5+
6+
describe('Login.vue', () => {
7+
it('should render expected contents', () => {
8+
const Constructor = Vue.extend(Login);
9+
const router = new Router();
10+
const vm = new Constructor({ router }).$mount();
11+
expect(vm.$el.querySelector('#login-view h1').textContent)
12+
.to.equal('Login');
13+
});
14+
});

client/yarn.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,14 @@ babel-plugin-transform-vue-jsx@^3.5.0:
898898
dependencies:
899899
esutils "^2.0.2"
900900

901+
babel-polyfill@^6.26.0:
902+
version "6.26.0"
903+
resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153"
904+
dependencies:
905+
babel-runtime "^6.26.0"
906+
core-js "^2.5.0"
907+
regenerator-runtime "^0.10.5"
908+
901909
babel-preset-env@^1.3.2:
902910
version "1.6.1"
903911
resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.6.1.tgz#a18b564cc9b9afdf4aae57ae3c1b0d99188e6f48"
@@ -6137,6 +6145,10 @@ regenerate@^1.2.1:
61376145
version "1.3.3"
61386146
resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f"
61396147

6148+
regenerator-runtime@^0.10.5:
6149+
version "0.10.5"
6150+
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658"
6151+
61406152
regenerator-runtime@^0.11.0:
61416153
version "0.11.1"
61426154
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9"

0 commit comments

Comments
 (0)