Browse Source

refactor(core): Replace "var" (#8299)

Replaces instances of "var" with "let" and "const" where applicable using the eslint 'no-var' and
'prefer-const' rules
dev
Sam Lichlyter 6 years ago
committed by Evan You
parent
commit
5489339a30
  1. 2
      scripts/build.js
  2. 8
      scripts/get-weex-version.js
  3. 4
      src/platforms/web/runtime/components/transition-group.js
  4. 2
      src/platforms/web/util/style.js
  5. 2
      src/platforms/weex/runtime/modules/style.js
  6. 14
      test/e2e/runner.js
  7. 6
      test/e2e/specs/grid.js
  8. 12
      test/e2e/specs/svg.js
  9. 4
      test/e2e/specs/tree.js
  10. 6
      test/helpers/to-have-been-warned.js
  11. 2
      test/helpers/trigger-event.js
  12. 6
      test/ssr/ssr-stream.spec.js
  13. 4
      test/unit/features/component/component-async.spec.js
  14. 2
      test/unit/features/component/component-keep-alive.spec.js
  15. 2
      test/unit/features/directives/class.spec.js
  16. 4
      test/unit/features/directives/for.spec.js
  17. 4
      test/unit/features/directives/model-radio.spec.js
  18. 20
      test/unit/features/directives/model-select.spec.js
  19. 2
      test/unit/features/directives/model-text.spec.js
  20. 8
      test/unit/features/directives/style.spec.js
  21. 4
      test/unit/features/instance/methods-data.spec.js
  22. 2
      test/unit/features/instance/methods-events.spec.js
  23. 8
      test/unit/features/options/functional.spec.js
  24. 12
      test/unit/features/options/watch.spec.js
  25. 2
      test/unit/features/transition/inject-styles.js
  26. 6
      test/unit/karma.base.config.js
  27. 4
      test/unit/karma.cover.config.js
  28. 2
      test/unit/karma.dev.config.js
  29. 8
      test/unit/karma.sauce.config.js
  30. 2
      test/unit/karma.unit.config.js

2
scripts/build.js

@ -48,7 +48,7 @@ function buildEntry (config) {
.then(bundle => bundle.generate(output)) .then(bundle => bundle.generate(output))
.then(({ code }) => { .then(({ code }) => {
if (isProd) { if (isProd) {
var minified = (banner ? banner + '\n' : '') + terser.minify(code, { const minified = (banner ? banner + '\n' : '') + terser.minify(code, {
output: { output: {
ascii_only: true ascii_only: true
}, },

8
scripts/get-weex-version.js

@ -1,7 +1,7 @@
var coreVersion = require('../package.json').version const coreVersion = require('../package.json').version
var weexVersion = require('../packages/weex-vue-framework/package.json').version const weexVersion = require('../packages/weex-vue-framework/package.json').version
var weexBaseVersion = weexVersion.match(/^[\d.]+/)[0] let weexBaseVersion = weexVersion.match(/^[\d.]+/)[0]
var weexSubVersion = Number(weexVersion.match(/-weex\.(\d+)$/)[1]) let weexSubVersion = Number(weexVersion.match(/-weex\.(\d+)$/)[1])
if (weexBaseVersion === coreVersion) { if (weexBaseVersion === coreVersion) {
// same core version, increment sub version // same core version, increment sub version

4
src/platforms/web/runtime/components/transition-group.js

@ -111,8 +111,8 @@ export default {
children.forEach((c: VNode) => { children.forEach((c: VNode) => {
if (c.data.moved) { if (c.data.moved) {
var el: any = c.elm const el: any = c.elm
var s: any = el.style const s: any = el.style
addTransitionClass(el, moveClass) addTransitionClass(el, moveClass)
s.transform = s.WebkitTransform = s.transitionDuration = '' s.transform = s.WebkitTransform = s.transitionDuration = ''
el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) { el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {

2
src/platforms/web/util/style.js

@ -8,7 +8,7 @@ export const parseStyleText = cached(function (cssText) {
const propertyDelimiter = /:(.+)/ const propertyDelimiter = /:(.+)/
cssText.split(listDelimiter).forEach(function (item) { cssText.split(listDelimiter).forEach(function (item) {
if (item) { if (item) {
var tmp = item.split(propertyDelimiter) const tmp = item.split(propertyDelimiter)
tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim()) tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim())
} }
}) })

2
src/platforms/weex/runtime/modules/style.js

@ -70,7 +70,7 @@ function updateStyle (oldVnode: VNodeWithData, vnode: VNodeWithData) {
function toObject (arr) { function toObject (arr) {
const res = {} const res = {}
for (var i = 0; i < arr.length; i++) { for (let i = 0; i < arr.length; i++) {
if (arr[i]) { if (arr[i]) {
extend(res, arr[i]) extend(res, arr[i])
} }

14
test/e2e/runner.js

@ -1,25 +1,25 @@
var path = require('path') const path = require('path')
var spawn = require('cross-spawn') const spawn = require('cross-spawn')
var httpServer = require('http-server') const httpServer = require('http-server')
var server = httpServer.createServer({ const server = httpServer.createServer({
root: path.resolve(__dirname, '../../') root: path.resolve(__dirname, '../../')
}) })
server.listen(8080) server.listen(8080)
var args = process.argv.slice(2) let args = process.argv.slice(2)
if (args.indexOf('--config') === -1) { if (args.indexOf('--config') === -1) {
args = args.concat(['--config', 'test/e2e/nightwatch.config.js']) args = args.concat(['--config', 'test/e2e/nightwatch.config.js'])
} }
if (args.indexOf('--env') === -1) { if (args.indexOf('--env') === -1) {
args = args.concat(['--env', 'chrome,phantomjs']) args = args.concat(['--env', 'chrome,phantomjs'])
} }
var i = args.indexOf('--test') const i = args.indexOf('--test')
if (i > -1) { if (i > -1) {
args[i + 1] = 'test/e2e/specs/' + args[i + 1] + '.js' args[i + 1] = 'test/e2e/specs/' + args[i + 1] + '.js'
} }
var runner = spawn('./node_modules/.bin/nightwatch', args, { const runner = spawn('./node_modules/.bin/nightwatch', args, {
stdio: 'inherit' stdio: 'inherit'
}) })

6
test/e2e/specs/grid.js

@ -1,6 +1,6 @@
module.exports = { module.exports = {
'grid': function (browser) { 'grid': function (browser) {
var columns = ['name', 'power'] const columns = ['name', 'power']
browser browser
.url('http://localhost:8080/examples/grid/') .url('http://localhost:8080/examples/grid/')
@ -92,8 +92,8 @@ module.exports = {
function assertTable (data) { function assertTable (data) {
browser.assert.count('td', data.length * columns.length) browser.assert.count('td', data.length * columns.length)
for (var i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
for (var j = 0; j < columns.length; j++) { for (let j = 0; j < columns.length; j++) {
browser.assert.containsText( browser.assert.containsText(
'tr:nth-child(' + (i + 1) + ') td:nth-child(' + (j + 1) + ')', 'tr:nth-child(' + (i + 1) + ') td:nth-child(' + (j + 1) + ')',
data[i][columns[j]] data[i][columns[j]]

12
test/e2e/specs/svg.js

@ -12,8 +12,8 @@ module.exports = {
.assert.count('button', 7) .assert.count('button', 7)
.assert.count('input[type="range"]', 6) .assert.count('input[type="range"]', 6)
.assert.evaluate(function () { .assert.evaluate(function () {
var points = stats.map(function (stat, i) { const points = stats.map(function (stat, i) {
var point = valueToPoint(stat.value, i, 6) const point = valueToPoint(stat.value, i, 6)
return point.x + ',' + point.y return point.x + ',' + point.y
}).join(' ') }).join(' ')
return document.querySelector('polygon').attributes[0].value === points return document.querySelector('polygon').attributes[0].value === points
@ -24,8 +24,8 @@ module.exports = {
.assert.count('button', 6) .assert.count('button', 6)
.assert.count('input[type="range"]', 5) .assert.count('input[type="range"]', 5)
.assert.evaluate(function () { .assert.evaluate(function () {
var points = stats.map(function (stat, i) { const points = stats.map(function (stat, i) {
var point = valueToPoint(stat.value, i, 5) const point = valueToPoint(stat.value, i, 5)
return point.x + ',' + point.y return point.x + ',' + point.y
}).join(' ') }).join(' ')
return document.querySelector('polygon').attributes[0].value === points return document.querySelector('polygon').attributes[0].value === points
@ -37,8 +37,8 @@ module.exports = {
.assert.count('button', 7) .assert.count('button', 7)
.assert.count('input[type="range"]', 6) .assert.count('input[type="range"]', 6)
.assert.evaluate(function () { .assert.evaluate(function () {
var points = stats.map(function (stat, i) { const points = stats.map(function (stat, i) {
var point = valueToPoint(stat.value, i, 6) const point = valueToPoint(stat.value, i, 6)
return point.x + ',' + point.y return point.x + ',' + point.y
}).join(' ') }).join(' ')
return document.querySelector('polygon').attributes[0].value === points return document.querySelector('polygon').attributes[0].value === points

4
test/e2e/specs/tree.js

@ -63,8 +63,8 @@ module.exports = {
.assert.count('.item > ul', 5) .assert.count('.item > ul', 5)
.assert.containsText('#demo ul > .item:nth-child(1)', '[-]') .assert.containsText('#demo ul > .item:nth-child(1)', '[-]')
.assert.evaluate(function () { .assert.evaluate(function () {
var firstItem = document.querySelector('#demo ul > .item:nth-child(1)') const firstItem = document.querySelector('#demo ul > .item:nth-child(1)')
var ul = firstItem.querySelector('ul') const ul = firstItem.querySelector('ul')
return ul.children.length === 2 return ul.children.length === 2
}) })
.end() .end()

6
test/helpers/to-have-been-warned.js

@ -14,8 +14,8 @@ let asserted
function createCompareFn (spy) { function createCompareFn (spy) {
const hasWarned = msg => { const hasWarned = msg => {
var count = spy.calls.count() let count = spy.calls.count()
var args let args
while (count--) { while (count--) {
args = spy.calls.argsFor(count) args = spy.calls.argsFor(count)
if (args.some(containsMsg)) { if (args.some(containsMsg)) {
@ -31,7 +31,7 @@ function createCompareFn (spy) {
return { return {
compare: msg => { compare: msg => {
asserted = asserted.concat(msg) asserted = asserted.concat(msg)
var warned = Array.isArray(msg) const warned = Array.isArray(msg)
? msg.some(hasWarned) ? msg.some(hasWarned)
: hasWarned(msg) : hasWarned(msg)
return { return {

2
test/helpers/trigger-event.js

@ -1,5 +1,5 @@
window.triggerEvent = function triggerEvent (target, event, process) { window.triggerEvent = function triggerEvent (target, event, process) {
var e = document.createEvent('HTMLEvents') const e = document.createEvent('HTMLEvents')
e.initEvent(event, true, true) e.initEvent(event, true, true)
if (process) process(e) if (process) process(e)
target.dispatchEvent(e) target.dispatchEvent(e)

6
test/ssr/ssr-stream.spec.js

@ -89,9 +89,9 @@ describe('SSR: renderToStream', () => {
template: `<div></div>`, template: `<div></div>`,
_scopeId: '_component2' _scopeId: '_component2'
}) })
var stream1 = renderToStream(component1) const stream1 = renderToStream(component1)
var stream2 = renderToStream(component2) const stream2 = renderToStream(component2)
var res = '' let res = ''
stream1.on('data', (text) => { stream1.on('data', (text) => {
res += text.toString('utf-8').replace(/x/g, '') res += text.toString('utf-8').replace(/x/g, '')
}) })

4
test/unit/features/component/component-async.spec.js

@ -79,7 +79,7 @@ describe('Component async', () => {
}) })
it('dynamic', done => { it('dynamic', done => {
var vm = new Vue({ const vm = new Vue({
template: '<component :is="view"></component>', template: '<component :is="view"></component>',
data: { data: {
view: 'view-a' view: 'view-a'
@ -103,7 +103,7 @@ describe('Component async', () => {
} }
} }
}).$mount() }).$mount()
var aCalled = false let aCalled = false
function step1 () { function step1 () {
// ensure A is resolved only once // ensure A is resolved only once
expect(aCalled).toBe(false) expect(aCalled).toBe(false)

2
test/unit/features/component/component-keep-alive.spec.js

@ -140,7 +140,7 @@ describe('Component keep-alive', () => {
components components
}).$mount() }).$mount()
var oneInstance = vm.$refs.one const oneInstance = vm.$refs.one
expect(vm.$el.textContent).toBe('two') expect(vm.$el.textContent).toBe('two')
assertHookCalls(one, [1, 1, 1, 0, 0]) assertHookCalls(one, [1, 1, 1, 0, 0])
assertHookCalls(two, [1, 1, 1, 0, 0]) assertHookCalls(two, [1, 1, 1, 0, 0])

2
test/unit/features/directives/class.spec.js

@ -5,7 +5,7 @@ function assertClass (assertions, done) {
template: '<div class="foo" :class="value"></div>', template: '<div class="foo" :class="value"></div>',
data: { value: '' } data: { value: '' }
}).$mount() }).$mount()
var chain = waitForUpdate() const chain = waitForUpdate()
assertions.forEach(([value, expected], i) => { assertions.forEach(([value, expected], i) => {
chain.then(() => { chain.then(() => {
if (typeof value === 'function') { if (typeof value === 'function') {

4
test/unit/features/directives/for.spec.js

@ -330,7 +330,7 @@ describe('Directive v-for', () => {
}).then(done) }).then(done)
function assertMarkup () { function assertMarkup () {
var markup = vm.list.map(function (item) { const markup = vm.list.map(function (item) {
return '<p>' + item.a + '</p><p>' + (item.a + 1) + '</p>' return '<p>' + item.a + '</p><p>' + (item.a + 1) + '</p>'
}).join('') }).join('')
expect(vm.$el.innerHTML).toBe(markup) expect(vm.$el.innerHTML).toBe(markup)
@ -370,7 +370,7 @@ describe('Directive v-for', () => {
}).then(done) }).then(done)
function assertMarkup () { function assertMarkup () {
var markup = vm.list.map(function (item) { const markup = vm.list.map(function (item) {
return `<p>${item.a}<span>${item.a}</span></p>` return `<p>${item.a}<span>${item.a}</span></p>`
}).join('') }).join('')
expect(vm.$el.innerHTML).toBe(markup) expect(vm.$el.innerHTML).toBe(markup)

4
test/unit/features/directives/model-radio.spec.js

@ -117,7 +117,7 @@ describe('Directive v-model radio', () => {
'</div>' '</div>'
}).$mount() }).$mount()
document.body.appendChild(vm.$el) document.body.appendChild(vm.$el)
var inputs = vm.$el.getElementsByTagName('input') const inputs = vm.$el.getElementsByTagName('input')
inputs[1].click() inputs[1].click()
waitForUpdate(() => { waitForUpdate(() => {
expect(vm.selections).toEqual(['b', '1']) expect(vm.selections).toEqual(['b', '1'])
@ -160,7 +160,7 @@ describe('Directive v-model radio', () => {
'<input type="radio" value="true" v-model="test" name="test">' + '<input type="radio" value="true" v-model="test" name="test">' +
'</div>' '</div>'
}).$mount() }).$mount()
var radioboxInput = vm.$el.children const radioboxInput = vm.$el.children
expect(radioboxInput[0].checked).toBe(false) expect(radioboxInput[0].checked).toBe(false)
expect(radioboxInput[1].checked).toBe(false) expect(radioboxInput[1].checked).toBe(false)
expect(radioboxInput[2].checked).toBe(true) expect(radioboxInput[2].checked).toBe(true)

20
test/unit/features/directives/model-select.spec.js

@ -4,9 +4,9 @@ import { looseEqual } from 'shared/util'
// Android 4.4 Chrome 30 has the bug that a multi-select option cannot be // Android 4.4 Chrome 30 has the bug that a multi-select option cannot be
// deselected by setting its "selected" prop via JavaScript. // deselected by setting its "selected" prop via JavaScript.
function hasMultiSelectBug () { function hasMultiSelectBug () {
var s = document.createElement('select') const s = document.createElement('select')
s.setAttribute('multiple', '') s.setAttribute('multiple', '')
var o = document.createElement('option') const o = document.createElement('option')
s.appendChild(o) s.appendChild(o)
o.selected = true o.selected = true
o.selected = false o.selected = false
@ -18,8 +18,8 @@ function hasMultiSelectBug () {
* we have to manually loop through the options * we have to manually loop through the options
*/ */
function updateSelect (el, value) { function updateSelect (el, value) {
var options = el.options const options = el.options
var i = options.length let i = options.length
while (i--) { while (i--) {
if (looseEqual(getValue(options[i]), value)) { if (looseEqual(getValue(options[i]), value)) {
options[i].selected = true options[i].selected = true
@ -245,7 +245,7 @@ describe('Directive v-model select', () => {
'<option>c</option>' + '<option>c</option>' +
'</select>' '</select>'
}).$mount() }).$mount()
var opts = vm.$el.options const opts = vm.$el.options
expect(opts[0].selected).toBe(false) expect(opts[0].selected).toBe(false)
expect(opts[1].selected).toBe(true) expect(opts[1].selected).toBe(true)
expect(opts[2].selected).toBe(false) expect(opts[2].selected).toBe(false)
@ -272,7 +272,7 @@ describe('Directive v-model select', () => {
'<option v-for="o in opts">{{ o }}</option>' + '<option v-for="o in opts">{{ o }}</option>' +
'</select>' '</select>'
}).$mount() }).$mount()
var opts = vm.$el.options const opts = vm.$el.options
expect(opts[0].selected).toBe(false) expect(opts[0].selected).toBe(false)
expect(opts[1].selected).toBe(true) expect(opts[1].selected).toBe(true)
expect(opts[2].selected).toBe(false) expect(opts[2].selected).toBe(false)
@ -345,7 +345,7 @@ describe('Directive v-model select', () => {
'<option selected>c</option>' + '<option selected>c</option>' +
'</select>' '</select>'
}).$mount() }).$mount()
var opts = vm.$el.options const opts = vm.$el.options
expect(opts[0].selected).toBe(true) expect(opts[0].selected).toBe(true)
expect(opts[1].selected).toBe(true) expect(opts[1].selected).toBe(true)
expect(opts[2].selected).toBe(true) expect(opts[2].selected).toBe(true)
@ -379,8 +379,8 @@ describe('Directive v-model select', () => {
'</div>' '</div>'
}).$mount() }).$mount()
document.body.appendChild(vm.$el) document.body.appendChild(vm.$el)
var selects = vm.$el.getElementsByTagName('select') const selects = vm.$el.getElementsByTagName('select')
var select0 = selects[0] const select0 = selects[0]
select0.options[0].selected = true select0.options[0].selected = true
triggerEvent(select0, 'change') triggerEvent(select0, 'change')
waitForUpdate(() => { waitForUpdate(() => {
@ -421,7 +421,7 @@ describe('Directive v-model select', () => {
'<option value="true">c</option>' + '<option value="true">c</option>' +
'</select>' '</select>'
}).$mount() }).$mount()
var opts = vm.$el.options const opts = vm.$el.options
expect(opts[0].selected).toBe(false) expect(opts[0].selected).toBe(false)
expect(opts[1].selected).toBe(true) expect(opts[1].selected).toBe(true)
expect(opts[2].selected).toBe(false) expect(opts[2].selected).toBe(false)

2
test/unit/features/directives/model-text.spec.js

@ -167,7 +167,7 @@ describe('Directive v-model text', () => {
'<span ref="rs">{{selections}}</span>' + '<span ref="rs">{{selections}}</span>' +
'</div>' '</div>'
}).$mount() }).$mount()
var inputs = vm.$el.getElementsByTagName('input') const inputs = vm.$el.getElementsByTagName('input')
inputs[1].value = 'test' inputs[1].value = 'test'
triggerEvent(inputs[1], 'input') triggerEvent(inputs[1], 'input')
waitForUpdate(() => { waitForUpdate(() => {

8
test/unit/features/directives/style.spec.js

@ -1,11 +1,11 @@
import Vue from 'vue' import Vue from 'vue'
function checkPrefixedProp (prop) { function checkPrefixedProp (prop) {
var el = document.createElement('div') const el = document.createElement('div')
var upper = prop.charAt(0).toUpperCase() + prop.slice(1) const upper = prop.charAt(0).toUpperCase() + prop.slice(1)
if (!(prop in el.style)) { if (!(prop in el.style)) {
var prefixes = ['Webkit', 'Moz', 'ms'] const prefixes = ['Webkit', 'Moz', 'ms']
var i = prefixes.length let i = prefixes.length
while (i--) { while (i--) {
if ((prefixes[i] + upper) in el.style) { if ((prefixes[i] + upper) in el.style) {
prop = prefixes[i] + upper prop = prefixes[i] + upper

4
test/unit/features/instance/methods-data.spec.js

@ -73,7 +73,7 @@ describe('Instance methods data', () => {
}) })
it('deep watch', done => { it('deep watch', done => {
var oldA = vm.a const oldA = vm.a
vm.$watch('a', spy, { deep: true }) vm.$watch('a', spy, { deep: true })
vm.a.b = 2 vm.a.b = 2
waitForUpdate(() => { waitForUpdate(() => {
@ -85,7 +85,7 @@ describe('Instance methods data', () => {
}) })
it('handler option', done => { it('handler option', done => {
var oldA = vm.a const oldA = vm.a
vm.$watch('a', { vm.$watch('a', {
handler: spy, handler: spy,
deep: true deep: true

2
test/unit/features/instance/methods-events.spec.js

@ -77,7 +77,7 @@ describe('Instance methods events', () => {
}) })
it('$off event + fn', () => { it('$off event + fn', () => {
var spy2 = jasmine.createSpy('emitter') const spy2 = jasmine.createSpy('emitter')
vm.$on('test', spy) vm.$on('test', spy)
vm.$on('test', spy2) vm.$on('test', spy2)
vm.$off('test', spy) vm.$off('test', spy)

8
test/unit/features/options/functional.spec.js

@ -244,8 +244,8 @@ describe('Options functional', () => {
it('should work with render fns compiled from template', done => { it('should work with render fns compiled from template', done => {
// code generated via vue-template-es2015-compiler // code generated via vue-template-es2015-compiler
var render = function (_h, _vm) { const render = function (_h, _vm) {
var _c = _vm._c const _c = _vm._c
return _c( return _c(
'div', 'div',
[ [
@ -261,9 +261,9 @@ describe('Options functional', () => {
2 2
) )
} }
var staticRenderFns = [ const staticRenderFns = [
function (_h, _vm) { function (_h, _vm) {
var _c = _vm._c const _c = _vm._c
return _c('div', [_vm._v('Some '), _c('span', [_vm._v('text')])]) return _c('div', [_vm._v('Some '), _c('span', [_vm._v('text')])])
} }
] ]

12
test/unit/features/options/watch.spec.js

@ -106,9 +106,9 @@ describe('Options watch', () => {
}) })
it('correctly merges multiple extends', done => { it('correctly merges multiple extends', done => {
var spy2 = jasmine.createSpy('A') const spy2 = jasmine.createSpy('A')
var spy3 = jasmine.createSpy('B') const spy3 = jasmine.createSpy('B')
var A = Vue.extend({ const A = Vue.extend({
data: function () { data: function () {
return { return {
a: 0, a: 0,
@ -120,21 +120,21 @@ describe('Options watch', () => {
} }
}) })
var B = Vue.extend({ const B = Vue.extend({
extends: A, extends: A,
watch: { watch: {
a: spy2 a: spy2
} }
}) })
var C = Vue.extend({ const C = Vue.extend({
extends: B, extends: B,
watch: { watch: {
a: spy3 a: spy3
} }
}) })
var vm = new C() const vm = new C()
vm.a = 1 vm.a = 1
waitForUpdate(() => { waitForUpdate(() => {

2
test/unit/features/transition/inject-styles.js

@ -1,5 +1,5 @@
function insertCSS (text) { function insertCSS (text) {
var cssEl = document.createElement('style') const cssEl = document.createElement('style')
cssEl.textContent = text.trim() cssEl.textContent = text.trim()
document.head.appendChild(cssEl) document.head.appendChild(cssEl)
} }

6
test/unit/karma.base.config.js

@ -1,7 +1,7 @@
var alias = require('../../scripts/alias') const alias = require('../../scripts/alias')
var webpack = require('webpack') const webpack = require('webpack')
var webpackConfig = { const webpackConfig = {
mode: 'development', mode: 'development',
resolve: { resolve: {
alias: alias alias: alias

4
test/unit/karma.cover.config.js

@ -1,7 +1,7 @@
var base = require('./karma.base.config.js') const base = require('./karma.base.config.js')
module.exports = function (config) { module.exports = function (config) {
var options = Object.assign(base, { const options = Object.assign(base, {
browsers: ['PhantomJS'], browsers: ['PhantomJS'],
reporters: ['mocha', 'coverage'], reporters: ['mocha', 'coverage'],
coverageReporter: { coverageReporter: {

2
test/unit/karma.dev.config.js

@ -1,4 +1,4 @@
var base = require('./karma.base.config.js') const base = require('./karma.base.config.js')
module.exports = function (config) { module.exports = function (config) {
config.set(Object.assign(base, { config.set(Object.assign(base, {

8
test/unit/karma.sauce.config.js

@ -1,5 +1,5 @@
var webpack = require('webpack') const webpack = require('webpack')
var base = require('./karma.base.config.js') const base = require('./karma.base.config.js')
base.webpack.plugins = [ base.webpack.plugins = [
new webpack.DefinePlugin({ new webpack.DefinePlugin({
@ -19,7 +19,7 @@ base.webpack.plugins = [
* smaller batches. * smaller batches.
*/ */
var batches = [ const batches = [
// the cool kids // the cool kids
{ {
sl_chrome: { sl_chrome: {
@ -79,7 +79,7 @@ var batches = [
] ]
module.exports = function (config) { module.exports = function (config) {
var batch = batches[process.argv[4] || 0] const batch = batches[process.argv[4] || 0]
config.set(Object.assign(base, { config.set(Object.assign(base, {
singleRun: true, singleRun: true,

2
test/unit/karma.unit.config.js

@ -1,4 +1,4 @@
var base = require('./karma.base.config.js') const base = require('./karma.base.config.js')
module.exports = function (config) { module.exports = function (config) {
config.set(Object.assign(base, { config.set(Object.assign(base, {

Loading…
Cancel
Save