Skip to content

Commit ba6dea0

Browse files
Updated code format to comply with linter.
Intentionally left SideNav.spec messy
1 parent 4bdb67e commit ba6dea0

File tree

4 files changed

+86
-86
lines changed

4 files changed

+86
-86
lines changed

template/src/main.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import * as Vue from 'vue'
2-
import App from './App'
1+
import * as Vue from "vue";
2+
import App from "./App";
33

4-
import './styles/main.css'
4+
import "./styles/main.css";
55

6-
var appContainer = document.createElement("div");
6+
let appContainer = document.createElement("div");
77
appContainer.id = "app";
88

99
document.body.appendChild(appContainer);
1010
/* eslint-disable no-new */
1111
new Vue({
12-
el: '#app',
13-
render: h => h(App)
14-
})
12+
el: "#app",
13+
render: h => h(App)
14+
});

template/test/unit/karma.conf.js

+13-15
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,40 @@
22
// http://karma-runner.github.io/0.13/config/configuration-file.html
33
// we are also using it with karma-webpack
44
// https://github.com/webpack/karma-webpack
5-
var webpackConfig = require('../../build/webpack.dev.conf')
6-
var path = require('path');
5+
const webpackConfig = require("../../build/webpack.dev.conf");
6+
const path = require("path");
77

88
module.exports = function(config) {
99
config.set({
1010
// to run in additional browsers:
1111
// 1. install corresponding karma launcher
1212
// http://karma-runner.github.io/0.13/config/browsers.html
1313
// 2. add it to the `browsers` array below.
14-
15-
browsers: ['PhantomJS'],
16-
frameworks: ['mocha', 'chai'],
17-
reporters: ['spec', 'coverage-istanbul'],
18-
14+
browsers: ["PhantomJS"],
15+
frameworks: ["mocha", "chai"],
16+
reporters: ["spec", "coverage-istanbul"],
1917
files: ["spec/**/*.ts"],
2018
preprocessors: {
21-
"spec/**/*.ts": ['webpack']
19+
"spec/**/*.ts": ["webpack"]
2220
},
2321
webpack: webpackConfig,
2422
webpackMiddleware: {
2523
noInfo: true
2624
},
2725
singleRun: true,
2826
coverageIstanbulReporter: {
29-
reports: ['html', 'text-summary'],
27+
"reports": ["html", "text-summary"],
3028
// base output directory. If you include %browser% in the path it will be replaced with the karma browser name
31-
dir: path.join(__dirname, './coverage'),
29+
"dir": path.join(__dirname, "./coverage"),
3230
// if using webpack and pre-loaders, work around webpack breaking the source path
33-
fixWebpackSourcePaths: true,
34-
'report-config': {
31+
"fixWebpackSourcePaths": true,
32+
"report-config": {
3533
// all options available at: https://github.com/istanbuljs/istanbul-reports/blob/590e6b0089f67b723a1fdf57bc7ccc080ff189d7/lib/html/index.js#L135-L137
3634
html: {
3735
// outputs the report in ./coverage/html
38-
subdir: 'html'
36+
subdir: "html"
3937
}
4038
}
4139
}
42-
})
43-
}
40+
});
41+
};
+23-24
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import Vue from 'vue'
2-
import SideNav from 'components/SideNav'
3-
import "chai";
1+
import Vue from "vue";
2+
import SideNav from "components/SideNav";
3+
import "chai";
44
const assert = chai.assert;
55

6-
describe('SideNav.vue', function () {
7-
beforeEach(function () {
8-
var main = document.getElementById("app");
6+
describe("SideNav.vue", () => {
7+
beforeEach(() => {
8+
let main = document.getElementById("app");
99
if (main) {
1010
main.innerHTML = "";
1111
} else {
@@ -15,45 +15,44 @@ describe('SideNav.vue', function () {
1515
}
1616
});
1717

18-
it('Hides Links Intially', function () {
19-
var vm = new SideNav().$mount("#app");
18+
it("Hides Links Intially", () => {
19+
let vm = new SideNav().$mount("#app");
2020

21-
// The only child is the 'Toggle Links' item
21+
// The only child is the "Toggle Links" item
2222
assert.equal(vm.$el.children.length, 1);
23-
});
23+
})
2424

25-
it('Shows links when clicked', function (done) {
26-
var vm = new SideNav().$mount("#app");
25+
it("Shows links when clicked", (done) => {
26+
let vm = new SideNav().$mount("#app");
2727

28-
// The only child is the 'Toggle Links' item
28+
// The only child is the "Toggle Links" item
2929
assert.equal(vm.$el.children.length, 1);
3030
(vm.$el.children[0] as HTMLElement).click();
3131

32-
Vue.nextTick(function() {
32+
Vue.nextTick(() => {
3333
// There are 3 links + 1 toggle link item.
3434
assert.equal(vm.$el.children.length, 4);
3535
done();
36-
})
36+
});
3737
});
3838

3939

40-
it('Toggles links properly', function (done) {
41-
var vm = new SideNav().$mount("#app");
40+
it("Toggles links properly", done => {
41+
let vm = new SideNav().$mount("#app");
4242

43-
// The only child is the 'Toggle Links' item
43+
// The only child is the "Toggle Links" item
4444
assert.equal(vm.$el.children.length, 1);
4545
(vm.$el.children[0] as HTMLElement).click();
4646

47-
Vue.nextTick(function() {
47+
Vue.nextTick(() => {
4848
assert.equal(vm.$el.children.length, 4);
4949
(vm.$el.children[0] as HTMLElement).click();
5050

5151
Vue.nextTick(function() {
5252
// Clicking it again should hide all links
5353
assert.equal(vm.$el.children.length, 1);
5454
done();
55-
})
56-
})
57-
})
58-
59-
});
55+
});
56+
});
57+
});
58+
});
+43-40
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import Vue from 'vue'
2-
import WinnerIsYou from 'components/WinnerIsYou'
3-
import "chai";
1+
import Vue from "vue";
2+
import WinnerIsYou from "components/WinnerIsYou";
3+
import "chai";
44
const assert = chai.assert;
55

6-
describe('WinnerIsYou.vue', function () {
7-
8-
beforeEach(function () {
9-
var main = document.getElementById("app");
6+
describe("WinnerIsYou.vue", () => {
7+
beforeEach(() => {
8+
let main = document.getElementById("app");
109
if (main) {
1110
main.innerHTML = "";
1211
} else {
@@ -16,46 +15,50 @@ describe('WinnerIsYou.vue', function () {
1615
}
1716
});
1817

19-
it('Renders nothing when showText undefined', function () {
20-
var vm = new WinnerIsYou().$mount("#app");
18+
it("Renders nothing when showText undefined", () => {
19+
let vm = new WinnerIsYou().$mount("#app");
2120

2221
assert.equal(vm.showText, null);
23-
assert.equal(vm.$el.textContent, '');
24-
})
22+
assert.equal(vm.$el.textContent, "");
23+
});
2524

2625

27-
it('Updates correctly', function (done) {
28-
var vm = new WinnerIsYou().$mount("#app");
29-
assert.equal(vm.showText, null)
30-
assert.equal(vm.$el.textContent, '')
31-
vm.showText = 'This page is intentionally styled poorly'
26+
it("Updates correctly", done => {
27+
let vm = new WinnerIsYou().$mount("#app");
28+
assert.equal(vm.showText, null);
29+
assert.equal(vm.$el.textContent, "");
30+
vm.showText = "This page is intentionally styled poorly";
3231

33-
Vue.nextTick(function () {
34-
assert.equal(vm.showText, 'This page is intentionally styled poorly')
35-
assert.equal(vm.$el.textContent, 'This page is intentionally styled poorly'.toUpperCase())
32+
Vue.nextTick(() => {
33+
assert.equal(vm.showText,
34+
"This page is intentionally styled poorly");
35+
assert.equal(vm.$el.textContent,
36+
"This page is intentionally styled poorly".toUpperCase());
3637
done();
37-
})
38-
})
38+
});
39+
});
3940

40-
it('Captializes correctly', function (done) {
41-
var vm = new WinnerIsYou().$mount("#app");
41+
it("Captializes correctly", done => {
42+
let vm = new WinnerIsYou().$mount("#app");
4243

43-
assert.equal(vm.showText, null)
44-
assert.equal(vm.$el.textContent, '')
45-
vm.showText = 'This page is intentionally styled poorly'
44+
assert.equal(vm.showText, null);
45+
assert.equal(vm.$el.textContent, "");
46+
vm.showText = "This page is intentionally styled poorly";
4647

47-
Vue.nextTick(function () {
48-
assert.equal(vm.showText, 'This page is intentionally styled poorly')
49-
assert.equal(vm.$el.textContent, 'This page is intentionally styled poorly'.toUpperCase())
48+
Vue.nextTick(() => {
49+
assert.equal(vm.showText,
50+
"This page is intentionally styled poorly");
51+
assert.equal(vm.$el.textContent,
52+
"This page is intentionally styled poorly".toUpperCase());
5053

51-
vm.showText = 'hUh';
52-
Vue.nextTick(function () {
53-
assert.notEqual(vm.showText, 'This page is intentionally styled poorly')
54-
assert.equal(vm.showText, 'hUh')
55-
assert.equal(vm.$el.textContent, 'huh'.toUpperCase())
56-
done();
57-
})
58-
})
59-
})
60-
61-
})
54+
vm.showText = "hUh";
55+
Vue.nextTick(() => {
56+
assert.notEqual(vm.showText,
57+
"This page is intentionally styled poorly");
58+
assert.equal(vm.showText, "hUh");
59+
assert.equal(vm.$el.textContent, "huh".toUpperCase());
60+
done();
61+
});
62+
});
63+
});
64+
});

0 commit comments

Comments
 (0)