"use strict" and other linty fixes

This commit is contained in:
Isiah Meadows 2017-03-02 07:26:52 -05:00
parent aaa6de784b
commit 1cc5fa5ba7
50 changed files with 463 additions and 478 deletions

View file

@ -1,4 +1,5 @@
#!/usr/bin/env node
"use strict"
var fs = require("fs")
var path = require("path")
@ -31,9 +32,9 @@ function traverseDirectory(pathname, callback) {
})
}
traverseDirectory(".", function(pathname, stat, children) {
traverseDirectory(".", function(pathname) {
if (pathname.match(/(?:^|\/)tests\/.*\.js$/)) {
require(path.normalize(process.cwd()) + "/" + pathname)
require(path.normalize(process.cwd()) + "/" + pathname) // eslint-disable-line global-require
}
})
.then(o.run)

View file

@ -1,3 +1,4 @@
/* eslint-disable no-bitwise, no-process-exit */
"use strict"
module.exports = new function init() {
@ -121,8 +122,8 @@ module.exports = new function init() {
}
function unique(subject) {
if (hasOwn.call(ctx, subject)) {
console.warn("A test or a spec named `" + subject + "` was already defined")
while (hasOwn.call(ctx, subject)) subject += '*'
console.warn("A test or a spec named `" + subject + "` was already defined")
while (hasOwn.call(ctx, subject)) subject += "*"
}
return subject
}

View file

@ -28,11 +28,11 @@ o.spec("ospec", function() {
o.beforeEach(function() {b = 1})
o.afterEach(function() {b = 0})
try {o('illegal assertion')} catch (e) {illegalAssertionThrows = true}
try {o("illegal assertion")} catch (e) {illegalAssertionThrows = true}
o("assertions", function() {
var nestedTestDeclarationThrows = false
try {o('illegal nested test', function(){})} catch (e) {nestedTestDeclarationThrows = true}
try {o("illegal nested test", function(){})} catch (e) {nestedTestDeclarationThrows = true}
o(illegalAssertionThrows).equals(true)
o(nestedTestDeclarationThrows).equals(true)
@ -51,7 +51,7 @@ o.spec("ospec", function() {
o(undef1).notDeepEquals(undef2)
o(undef1).notDeepEquals({})
o({}).notDeepEquals(undef1)
var sparse1 = [void 1, void 2, void 3]
delete sparse1[0]
var sparse2 = [void 1, void 2, void 3]
@ -63,7 +63,7 @@ o.spec("ospec", function() {
monkeypatch1.field = 3
var monkeypatch2 = [1, 2]
monkeypatch2.field = 4
o(monkeypatch1).notDeepEquals([1, 2])
o(monkeypatch1).notDeepEquals(monkeypatch2)