Skip to content

Commit

Permalink
[eslint] enable quotes rule
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Feb 25, 2020
1 parent 4526b39 commit d686aa2
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 48 deletions.
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"rules": {
"indent": ["error", 4],
"key-spacing": "error",
"quotes": ["error", "single", {
"avoidEscape": true,
}],
"semi": ["error", "always"],
"space-before-function-paren": ["error", {
"anonymous": "always",
Expand Down
2 changes: 1 addition & 1 deletion test/circular-things.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ tap.test('circular test', function (assert) {
);
}));

test("circular", function (t) {
test('circular', function (t) {
t.plan(1);
var circular = {};
circular.circular = circular;
Expand Down
2 changes: 1 addition & 1 deletion test/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ tap.test('non-string types', function (assert) {
t.comment(42);
t.comment(6.66);
t.comment({});
t.comment({"answer": 42});
t.comment({'answer': 42});
function ConstructorFunction() {}
t.comment(new ConstructorFunction());
t.comment(ConstructorFunction);
Expand Down
2 changes: 1 addition & 1 deletion test/create_multiple_streams.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ tape.test('createMultipleStreams', function (tt) {
});

th.onFinish(function () {
tt.equal(th._results.count, 2, "harness test ran");
tt.equal(th._results.count, 2, 'harness test ran');
tt.equal(th._results.fail, 0, "harness test didn't fail");
});
});
Expand Down
6 changes: 3 additions & 3 deletions test/deep-equal-failure.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ tap.test('deep equal failure', function (assert) {
});
});

test("deep equal", function (t) {
test('deep equal', function (t) {
t.plan(1);
t.equal({a: 1}, {b: 2});
});
Expand Down Expand Up @@ -123,7 +123,7 @@ tap.test('deep equal failure, depth 6, with option', function (assert) {
});
});

test("deep equal", {objectPrintDepth: 6}, function (t) {
test('deep equal', {objectPrintDepth: 6}, function (t) {
t.plan(1);
t.equal({ a: { a1: { a2: { a3: { a4: { a5: 1 } } } } } }, { a: { a1: { a2: { a3: { a4: { a5: 2 } } } } } });
});
Expand Down Expand Up @@ -184,7 +184,7 @@ tap.test('deep equal failure, depth 6, without option', function (assert) {
});
});

test("deep equal", function (t) {
test('deep equal', function (t) {
t.plan(1);
t.equal({ a: { a1: { a2: { a3: { a4: { a5: 1 } } } } } }, { a: { a1: { a2: { a3: { a4: { a5: 2 } } } } } });
});
Expand Down
28 changes: 14 additions & 14 deletions test/end-as-callback.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
var tap = require("tap");
var forEach = require("for-each");
var tape = require("../");
var tap = require('tap');
var forEach = require('for-each');
var tape = require('../');
var concat = require('concat-stream');

tap.test("tape assert.end as callback", function (tt) {
tap.test('tape assert.end as callback', function (tt) {
var test = tape.createHarness({ exit: false });

test.createStream().pipe(concat(function (rows) {
Expand All @@ -26,35 +26,35 @@ tap.test("tape assert.end as callback", function (tt) {
tt.end();
}));

test("do a task and write", function (assert) {
fakeAsyncTask("foo", function (err, value) {
test('do a task and write', function (assert) {
fakeAsyncTask('foo', function (err, value) {
assert.ifError(err);
assert.equal(value, "taskfoo");
assert.equal(value, 'taskfoo');

fakeAsyncWrite("bar", assert.end);
fakeAsyncWrite('bar', assert.end);
});
});

test("do a task and write fail", function (assert) {
fakeAsyncTask("bar", function (err, value) {
test('do a task and write fail', function (assert) {
fakeAsyncTask('bar', function (err, value) {
assert.ifError(err);
assert.equal(value, "taskbar");
assert.equal(value, 'taskbar');

fakeAsyncWriteFail("baz", assert.end);
fakeAsyncWriteFail('baz', assert.end);
});
});
});

function fakeAsyncTask(name, cb) {
cb(null, "task" + name);
cb(null, 'task' + name);
}

function fakeAsyncWrite(name, cb) {
cb(null);
}

function fakeAsyncWriteFail(name, cb) {
cb(new Error("fail"));
cb(new Error('fail'));
}

/**
Expand Down
6 changes: 3 additions & 3 deletions test/not-deep-equal-failure.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ tap.test('deep equal failure', function (assert) {
});
});

test("not deep equal", function (t) {
test('not deep equal', function (t) {
t.plan(1);
t.notDeepEqual({b: 2}, {b: 2});
});
Expand Down Expand Up @@ -123,7 +123,7 @@ tap.test('not deep equal failure, depth 6, with option', function (assert) {
});
});

test("not deep equal", {objectPrintDepth: 6}, function (t) {
test('not deep equal', {objectPrintDepth: 6}, function (t) {
t.plan(1);
t.notDeepEqual({ a: { a1: { a2: { a3: { a4: { a5: 1 } } } } } }, { a: { a1: { a2: { a3: { a4: { a5: 1 } } } } } });
});
Expand Down Expand Up @@ -184,7 +184,7 @@ tap.test('not deep equal failure, depth 6, without option', function (assert) {
});
});

test("not deep equal", function (t) {
test('not deep equal', function (t) {
t.plan(1);
t.notDeepEqual({ a: { a1: { a2: { a3: { a4: { a5: 1 } } } } } }, { a: { a1: { a2: { a3: { a4: { a5: 1 } } } } } });
});
Expand Down
2 changes: 1 addition & 1 deletion test/not-equal-failure.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ tap.test('not equal failure', function (assert) {
});
});

test("not equal", function (t) {
test('not equal', function (t) {
t.plan(1);
t.notEqual(2, 2);
});
Expand Down
10 changes: 5 additions & 5 deletions test/onFailure.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
var tap = require("tap");
var tape = require("../").createHarness();
var tap = require('tap');
var tape = require('../').createHarness();

//Because this test passing depends on a failure,
//we must direct the failing output of the inner test
var noop = function () {};
var mockSink = {on: noop, removeListener: noop, emit: noop, end: noop};
tape.createStream().pipe(mockSink);

tap.test("on failure", { timeout: 1000 }, function (tt) {
tap.test('on failure', { timeout: 1000 }, function (tt) {
tt.plan(1);

tape("dummy test", function (t) {
tape('dummy test', function (t) {
t.fail();
t.end();
});

tape.onFailure(function () {
tt.pass("tape ended");
tt.pass('tape ended');
});
});
6 changes: 3 additions & 3 deletions test/onFinish.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var tap = require("tap");
var tape = require("../");
var tap = require('tap');
var tape = require('../');

tap.test("on finish", {timeout: 1000}, function (tt) {
tap.test('on finish', {timeout: 1000}, function (tt) {
tt.plan(1);
tape.onFinish(function () {
tt.pass('tape ended');
Expand Down
2 changes: 1 addition & 1 deletion test/only-twice.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var tap = require('tap');
tap.test('only twice error', function (assert) {
var test = tape.createHarness({ exit: false });

test.only("first only", function (t) {
test.only('first only', function (t) {
t.end();
});

Expand Down
8 changes: 4 additions & 4 deletions test/only.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ tap.test('tape only test', function (tt) {

test.createStream().pipe(concat(tc));

test("never run fail", function (t) {
test('never run fail', function (t) {
ran.push(1);
t.equal(true, false);
t.end();
});

test("never run success", function (t) {
test('never run success', function (t) {
ran.push(2);
t.equal(true, true);
t.end();
});

test.only("run success", function (t) {
test.only('run success', function (t) {
ran.push(3);
t.ok(true, "assert name");
t.ok(true, 'assert name');
t.end();
});
});
6 changes: 3 additions & 3 deletions test/stackTrace.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tap.test('preserves stack trace with newlines', function (tt) {
tt.deepEqual(data, {
ok: false,
id: 1,
name: "Error: Preserve stack",
name: 'Error: Preserve stack',
diag: {
stack: stackTrace,
operator: 'error',
Expand Down Expand Up @@ -121,7 +121,7 @@ tap.test('preserves stack trace for failed assertions', function (tt) {
tt.deepEqual(data, {
ok: false,
id: 1,
name: "true should be false",
name: 'true should be false',
diag: {
at: at,
stack: stack,
Expand Down Expand Up @@ -186,7 +186,7 @@ tap.test('preserves stack trace for failed assertions where actual===falsy', fun
tt.deepEqual(data, {
ok: false,
id: 1,
name: "false should be true",
name: 'false should be true',
diag: {
at: at,
stack: stack,
Expand Down
16 changes: 8 additions & 8 deletions test/throws.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ tap.test('failures', function (tt) {
+ ' expected: |-\n'
+ ' undefined\n'
+ ' actual: |-\n'
+ " { [TypeError: " + getNonFunctionMessage() + "] message: '" + getNonFunctionMessage() + "' }\n"
+ ' { [TypeError: ' + getNonFunctionMessage() + "] message: '" + getNonFunctionMessage() + "' }\n"
+ ' at: Test.<anonymous> ($TEST/throws.js:$LINE:$COL)\n'
+ ' stack: |-\n'
+ ' TypeError: ' + getNonFunctionMessage(undefined) + '\n'
Expand All @@ -53,7 +53,7 @@ tap.test('failures', function (tt) {
+ ' expected: |-\n'
+ ' undefined\n'
+ ' actual: |-\n'
+ " { [TypeError: " + getNonFunctionMessage(null) + "] message: '" + getNonFunctionMessage(null) + "' }\n"
+ ' { [TypeError: ' + getNonFunctionMessage(null) + "] message: '" + getNonFunctionMessage(null) + "' }\n"
+ ' at: Test.<anonymous> ($TEST/throws.js:$LINE:$COL)\n'
+ ' stack: |-\n'
+ ' TypeError: ' + getNonFunctionMessage(null) + '\n'
Expand All @@ -67,7 +67,7 @@ tap.test('failures', function (tt) {
+ ' expected: |-\n'
+ ' undefined\n'
+ ' actual: |-\n'
+ " { [TypeError: " + getNonFunctionMessage(true) + "] message: '" + getNonFunctionMessage(true) + "' }\n"
+ ' { [TypeError: ' + getNonFunctionMessage(true) + "] message: '" + getNonFunctionMessage(true) + "' }\n"
+ ' at: Test.<anonymous> ($TEST/throws.js:$LINE:$COL)\n'
+ ' stack: |-\n'
+ ' TypeError: ' + getNonFunctionMessage(true) + '\n'
Expand All @@ -81,7 +81,7 @@ tap.test('failures', function (tt) {
+ ' expected: |-\n'
+ ' undefined\n'
+ ' actual: |-\n'
+ " { [TypeError: " + getNonFunctionMessage(false) + "] message: '" + getNonFunctionMessage(false) + "' }\n"
+ ' { [TypeError: ' + getNonFunctionMessage(false) + "] message: '" + getNonFunctionMessage(false) + "' }\n"
+ ' at: Test.<anonymous> ($TEST/throws.js:$LINE:$COL)\n'
+ ' stack: |-\n'
+ ' TypeError: ' + getNonFunctionMessage(false) + '\n'
Expand All @@ -95,7 +95,7 @@ tap.test('failures', function (tt) {
+ ' expected: |-\n'
+ ' undefined\n'
+ ' actual: |-\n'
+ " { [TypeError: " + getNonFunctionMessage('abc') + "] message: '" + getNonFunctionMessage('abc') + "' }\n"
+ ' { [TypeError: ' + getNonFunctionMessage('abc') + "] message: '" + getNonFunctionMessage('abc') + "' }\n"
+ ' at: Test.<anonymous> ($TEST/throws.js:$LINE:$COL)\n'
+ ' stack: |-\n'
+ ' TypeError: ' + getNonFunctionMessage('abc') + '\n'
Expand All @@ -109,7 +109,7 @@ tap.test('failures', function (tt) {
+ ' expected: |-\n'
+ ' undefined\n'
+ ' actual: |-\n'
+ " { [TypeError: " + getNonFunctionMessage(/a/g) + "] message: '" + getNonFunctionMessage(/a/g) + "' }\n"
+ ' { [TypeError: ' + getNonFunctionMessage(/a/g) + "] message: '" + getNonFunctionMessage(/a/g) + "' }\n"
+ ' at: Test.<anonymous> ($TEST/throws.js:$LINE:$COL)\n'
+ ' stack: |-\n'
+ ' TypeError: ' + getNonFunctionMessage(/a/g) + '\n'
Expand All @@ -123,7 +123,7 @@ tap.test('failures', function (tt) {
+ ' expected: |-\n'
+ ' undefined\n'
+ ' actual: |-\n'
+ " { [TypeError: " + getNonFunctionMessage([]) + "] message: '" + getNonFunctionMessage([]) + "' }\n"
+ ' { [TypeError: ' + getNonFunctionMessage([]) + "] message: '" + getNonFunctionMessage([]) + "' }\n"
+ ' at: Test.<anonymous> ($TEST/throws.js:$LINE:$COL)\n'
+ ' stack: |-\n'
+ ' TypeError: ' + getNonFunctionMessage([]) + '\n'
Expand All @@ -137,7 +137,7 @@ tap.test('failures', function (tt) {
+ ' expected: |-\n'
+ ' undefined\n'
+ ' actual: |-\n'
+ " { [TypeError: " + getNonFunctionMessage({}) + "] message: '" + getNonFunctionMessage({}) + "' }\n"
+ ' { [TypeError: ' + getNonFunctionMessage({}) + "] message: '" + getNonFunctionMessage({}) + "' }\n"
+ ' at: Test.<anonymous> ($TEST/throws.js:$LINE:$COL)\n'
+ ' stack: |-\n'
+ ' TypeError: ' + getNonFunctionMessage({}) + '\n'
Expand Down

0 comments on commit d686aa2

Please sign in to comment.