Skip to content

Commit

Permalink
chore: Fix linting after eslint updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Sep 5, 2015
1 parent 9771086 commit 9690d4e
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 35 deletions.
10 changes: 5 additions & 5 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ var createPatternObject = function (pattern) {

if (helper.isObject(pattern)) {
if (pattern.pattern && helper.isString(pattern.pattern)) {
return helper.isUrlAbsolute(pattern.pattern) ?
new UrlPattern(pattern.pattern) :
new Pattern(
return helper.isUrlAbsolute(pattern.pattern)
? new UrlPattern(pattern.pattern)
: new Pattern(
pattern.pattern,
pattern.served,
pattern.included,
Expand Down Expand Up @@ -166,8 +166,8 @@ var normalizeConfig = function (config, configFilePath) {
Object.keys(preprocessors).forEach(function (pattern) {
var normalizedPattern = helper.normalizeWinPath(basePathResolve(pattern))

normalizedPreprocessors[normalizedPattern] = helper.isString(preprocessors[pattern]) ?
[preprocessors[pattern]] : preprocessors[pattern]
normalizedPreprocessors[normalizedPattern] = helper.isString(preprocessors[pattern])
? [preprocessors[pattern]] : preprocessors[pattern]
})

// define custom launchers/preprocessors/reporters - create an inlined plugin
Expand Down
5 changes: 1 addition & 4 deletions lib/file-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ function byPath (a, b) {
// preprocess - Function
// batchInterval - Number
var List = function (patterns, excludes, emitter, preprocess, batchInterval) {

// Store options
this._patterns = patterns
this._excludes = excludes
Expand Down Expand Up @@ -80,8 +79,8 @@ var List = function (patterns, excludes, emitter, preprocess, batchInterval) {
self._emitModified = function (immediate) {
immediate ? emit() : throttledEmit()
}

}

// Private Interface
// -----------------

Expand Down Expand Up @@ -116,7 +115,6 @@ List.prototype._isIncluded = function (path) {
//
// Returns a File or undefined
List.prototype._findFile = function (path, pattern) {

if (!path || !pattern) return
if (!this.buckets.has(pattern.pattern)) return

Expand Down Expand Up @@ -309,7 +307,6 @@ List.prototype.addFile = function (path) {
fs.statAsync(path),
this._refreshing
]).spread(function (stat) {

file.mtime = stat.mtime
return self._preprocess(file)
})
Expand Down
1 change: 0 additions & 1 deletion lib/reporters/dots.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ var DotsReporter = function (formatError, reportSlow) {
}

this.write(msg)

}

this.specSuccess = function () {
Expand Down
8 changes: 6 additions & 2 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ var Server = function (cliOptions, done) {
capturedBrowsers: ['type', BrowserCollection],
args: ['value', {}],
timer: ['value', {
setTimeout: function () { return setTimeout.apply(root, arguments)},
clearTimeout: function (timeoutId) { clearTimeout(timeoutId)}
setTimeout: function () {
return setTimeout.apply(root, arguments)
},
clearTimeout: function (timeoutId) {
clearTimeout(timeoutId)
}
}]
}]

Expand Down
6 changes: 0 additions & 6 deletions scripts/init-dev-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ var installGruntCli = function (callback) {
} else {
callback()
}

})

gcli.stdout.pipe(process.stdout)
gcli.stderr.pipe(process.stderr)

}

var checkForGruntCli = function (callback) {
Expand All @@ -59,7 +57,6 @@ var checkForGruntCli = function (callback) {
console.log(stdout)
callback()
}

})
}

Expand Down Expand Up @@ -88,15 +85,13 @@ var installDependencies = function () {

install.stdout.pipe(process.stdout)
install.stderr.pipe(process.stderr)

}

var runInit = function () {
gitHookSetup()
checkForGruntCli(function cb () {
installDependencies()
})

}

if (isWin) {
Expand All @@ -108,7 +103,6 @@ if (isWin) {
runInit()
}
})

} else {
runInit()
}
4 changes: 1 addition & 3 deletions test/unit/config.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('config', () => {
'/home/config4.js': wrapCfg({port: 123, autoWatch: true, basePath: '/abs/base'}),
'/home/config6.js': wrapCfg({reporters: 'junit'}),
'/home/config7.js': wrapCfg({browsers: ['Chrome', 'Firefox']}),
'/conf/invalid.js': () => {throw new SyntaxError('Unexpected token =')},
'/conf/invalid.js': () => { throw new SyntaxError('Unexpected token =') },
'/conf/exclude.js': wrapCfg({exclude: ['one.js', 'sub/two.js']}),
'/conf/absolute.js': wrapCfg({files: ['http://some.com', 'https://more.org/file.js']}),
'/conf/both.js': wrapCfg({files: ['one.js', 'two.js'], exclude: ['third.js']}),
Expand Down Expand Up @@ -228,7 +228,6 @@ describe('config', () => {
})

it('should validate and format the protocol', () => {

var config = normalizeConfigWithDefaults({})
expect(config.protocol).to.equal('http:')

Expand All @@ -246,7 +245,6 @@ describe('config', () => {

config = normalizeConfigWithDefaults({ protocol: 'unsupported:' })
expect(config.protocol).to.equal('http:')

})
})

Expand Down
1 change: 0 additions & 1 deletion test/unit/middleware/runner.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ describe('middleware.runner', () => {
})

beforeEach(() => {

mockReporter = {
adapters: [],
write (msg) {
Expand Down
1 change: 0 additions & 1 deletion test/unit/mocha-globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ chai.use((chai, utils) => {
`expected response status to not be set, it was '#{response._status}'`)
this.assert(response._body === null,
`expected response body to not be set, it was '#{response._body}'`)

})
})

Expand Down
1 change: 0 additions & 1 deletion test/unit/watcher.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import mocks from 'mocks'
import path from 'path'

describe('watcher', () => {

var config = require('../../lib/config')

var m = null
Expand Down
11 changes: 0 additions & 11 deletions test/unit/web-server.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ describe('web-server', () => {
}

describe('request', () => {

beforeEach(() => {
customFileHandlers = []
emitter = new EventEmitter()
Expand Down Expand Up @@ -119,13 +118,10 @@ describe('web-server', () => {
.get('/non/existing.html')
.expect(404)
})

})

describe('https', () => {

beforeEach(() => {

var credentials = {
key: fs.readFileSync(__dirname + '/certificates/server.key'),
cert: fs.readFileSync(__dirname + '/certificates/server.crt')
Expand All @@ -146,27 +142,20 @@ describe('web-server', () => {
}])

server = injector.invoke(m.createWebServer)

})

it('should be an instance of https.Server', () => {

expect(server instanceof require('https').Server).to.equal(true)

})

it('should serve client.html', () => {

servedFiles(new Set())

process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'

return request(server)
.get('/')
.expect(200, 'CLIENT HTML')

})

})

})

0 comments on commit 9690d4e

Please sign in to comment.