Skip to content

Commit

Permalink
[Refactor] make everything strict mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Dec 30, 2019
1 parent 0715294 commit 11b7d85
Show file tree
Hide file tree
Showing 101 changed files with 201 additions and 1 deletion.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"named": "never",
}],
"no-undef": "error",
"strict": "error",
},
"overrides": [
{
Expand Down
2 changes: 2 additions & 0 deletions bin/tape
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env node

'use strict';

var resolveModule = require('resolve').sync;
var resolvePath = require('path').resolve;
var parseOpts = require('minimist');
Expand Down
2 changes: 2 additions & 0 deletions example/array.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var falafel = require('falafel');
var test = require('../');

Expand Down
2 changes: 2 additions & 0 deletions example/fail.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var falafel = require('falafel');
var test = require('../');

Expand Down
2 changes: 2 additions & 0 deletions example/nested.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var falafel = require('falafel');
var test = require('../');

Expand Down
2 changes: 2 additions & 0 deletions example/nested_fail.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var falafel = require('falafel');
var test = require('../');

Expand Down
2 changes: 2 additions & 0 deletions example/no_callback.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../');

test('No cb test');
2 changes: 2 additions & 0 deletions example/not_enough.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var falafel = require('falafel');
var test = require('../');

Expand Down
2 changes: 2 additions & 0 deletions example/static/server.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var http = require('http');
var ecstatic = require('ecstatic')(__dirname);
var server = http.createServer(ecstatic);
Expand Down
2 changes: 2 additions & 0 deletions example/stream/object.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../../');
var path = require('path');

Expand Down
2 changes: 2 additions & 0 deletions example/stream/tap.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../../');
var path = require('path');

Expand Down
2 changes: 2 additions & 0 deletions example/stream/test/x.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../../../');
test(function (t) {
t.plan(1);
Expand Down
2 changes: 2 additions & 0 deletions example/stream/test/y.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../../../');
test(function (t) {
t.plan(2);
Expand Down
2 changes: 2 additions & 0 deletions example/throw.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var falafel = require('falafel');
var test = require('../');

Expand Down
2 changes: 2 additions & 0 deletions example/timing.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../');

test('timing test', function (t) {
Expand Down
2 changes: 2 additions & 0 deletions example/too_many.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var falafel = require('falafel');
var test = require('../');

Expand Down
2 changes: 2 additions & 0 deletions example/two.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../');

test('one', function (t) {
Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var defined = require('defined');
var createDefaultStream = require('./lib/default_stream');
var Test = require('./lib/test');
Expand Down
2 changes: 2 additions & 0 deletions lib/default_stream.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var through = require('through');
var fs = require('fs');

Expand Down
2 changes: 2 additions & 0 deletions lib/results.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var defined = require('defined');
var EventEmitter = require('events').EventEmitter;
var inherits = require('inherits');
Expand Down
1 change: 1 addition & 0 deletions lib/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use strict";

var deepEqual = require('deep-equal');
var defined = require('defined');
var path = require('path');
Expand Down
2 changes: 2 additions & 0 deletions test/add-subtest-async.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../');

test('parent', function (t) {
Expand Down
2 changes: 2 additions & 0 deletions test/anonymous-fn.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var tape = require('../');
var tap = require('tap');
var concat = require('concat-stream');
Expand Down
2 changes: 2 additions & 0 deletions test/anonymous-fn/test-wrapper.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

// Example of wrapper function that would invoke tape
module.exports = function (testCase) {
return function (t) {
Expand Down
2 changes: 2 additions & 0 deletions test/array.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var falafel = require('falafel');
var tape = require('../');
var tap = require('tap');
Expand Down
4 changes: 3 additions & 1 deletion test/async-await.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var tap = require('tap');

var stripFullStack = require('./common').stripFullStack;
Expand Down Expand Up @@ -185,7 +187,7 @@ tap.test('sync-error', function (t) {
stderr = lines.join('\n');

t.same(stripFullStack(stderr), [
'$TEST/async-await/sync-error.js:5',
'$TEST/async-await/sync-error.js:7',
' throw new Error(\'oopsie\');',
' ^',
'',
Expand Down
2 changes: 2 additions & 0 deletions test/async-await/async-error.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../../');

test('async-error', async function myTest(t) {
Expand Down
2 changes: 2 additions & 0 deletions test/async-await/async1.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../../');

test('async1', async function myTest(t) {
Expand Down
2 changes: 2 additions & 0 deletions test/async-await/async2.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../../');

test('async2', async function myTest(t) {
Expand Down
2 changes: 2 additions & 0 deletions test/async-await/async3.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../../');

test('async3', async function myTest(t) {
Expand Down
2 changes: 2 additions & 0 deletions test/async-await/async4.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../../');

test('async4', async function myTest(t) {
Expand Down
2 changes: 2 additions & 0 deletions test/async-await/async5.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var util = require('util');
var http = require('http');

Expand Down
2 changes: 2 additions & 0 deletions test/async-await/sync-error.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../../');

test('sync-error', function myTest(t) {
Expand Down
2 changes: 2 additions & 0 deletions test/bound.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../');

test('bind works', function (t) {
Expand Down
2 changes: 2 additions & 0 deletions test/browser/asserts.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../../');

test(function (t) {
Expand Down
2 changes: 2 additions & 0 deletions test/child_ordering.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../');

var childRan = false;
Expand Down
2 changes: 2 additions & 0 deletions test/circular-things.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var tape = require('../');
var tap = require('tap');
var concat = require('concat-stream');
Expand Down
2 changes: 2 additions & 0 deletions test/comment.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var concat = require('concat-stream');
var tap = require('tap');
var tape = require('../');
Expand Down
2 changes: 2 additions & 0 deletions test/common.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var path = require('path');
var spawn = require('child_process').spawn;
var concat = require('concat-stream');
Expand Down
2 changes: 2 additions & 0 deletions test/create_multiple_streams.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var tape = require('../');

tape.test('createMultipleStreams', function (tt) {
Expand Down
2 changes: 2 additions & 0 deletions test/deep-equal-failure.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var tape = require('../');
var tap = require('tap');
var concat = require('concat-stream');
Expand Down
2 changes: 2 additions & 0 deletions test/deep.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../');

test('deep strict equal', function (t) {
Expand Down
2 changes: 2 additions & 0 deletions test/default-messages.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var tap = require('tap');
var path = require('path');
var spawn = require('child_process').spawn;
Expand Down
2 changes: 2 additions & 0 deletions test/double_end.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('tap').test;
var path = require('path');
var concat = require('concat-stream');
Expand Down
2 changes: 2 additions & 0 deletions test/double_end/double.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../../');

test('double end', function (t) {
Expand Down
2 changes: 2 additions & 0 deletions test/end-as-callback.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var tap = require("tap");
var forEach = require("for-each");
var tape = require("../");
Expand Down
2 changes: 2 additions & 0 deletions test/error.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var tape = require('../');
var tap = require('tap');
var concat = require('concat-stream');
Expand Down
2 changes: 2 additions & 0 deletions test/exit.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var tap = require('tap');
var path = require('path');
var spawn = require('child_process').spawn;
Expand Down
2 changes: 2 additions & 0 deletions test/exit/fail.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../../');
var falafel = require('falafel');

Expand Down
2 changes: 2 additions & 0 deletions test/exit/ok.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var falafel = require('falafel');
var test = require('../../');

Expand Down
2 changes: 2 additions & 0 deletions test/exit/second.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../../');

test('first', function (t) {
Expand Down
2 changes: 2 additions & 0 deletions test/exit/todo.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../../');

test('todo pass', { todo: true }, function (t) {
Expand Down
2 changes: 2 additions & 0 deletions test/exit/todo_fail.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../../');

test('todo fail', { todo: true }, function (t) {
Expand Down
2 changes: 2 additions & 0 deletions test/exit/too_few.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var falafel = require('falafel');
var test = require('../../');

Expand Down
2 changes: 2 additions & 0 deletions test/exposed-harness.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var tape = require('../');
var tap = require('tap');

Expand Down
2 changes: 2 additions & 0 deletions test/fail.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var falafel = require('falafel');
var tape = require('../');
var tap = require('tap');
Expand Down
2 changes: 2 additions & 0 deletions test/has spaces.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var tape = require('../');
var tap = require('tap');
var concat = require('concat-stream');
Expand Down
2 changes: 2 additions & 0 deletions test/many.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../');

test('many tests', function (t) {
Expand Down
2 changes: 2 additions & 0 deletions test/max_listeners.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var spawn = require('child_process').spawn;
var path = require('path');

Expand Down
2 changes: 2 additions & 0 deletions test/max_listeners/source.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../../');

for (var i = 0; i < 11; i ++) {
Expand Down
2 changes: 2 additions & 0 deletions test/messages/defaults.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../../');

test('default messages', function (t) {
Expand Down
2 changes: 2 additions & 0 deletions test/nested-async-plan-noend.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var test = require('../');

test('Harness async test support', function (t) {
Expand Down
2 changes: 2 additions & 0 deletions test/nested-sync-noplan-noend.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var tape = require('../');
var tap = require('tap');
var concat = require('concat-stream');
Expand Down
2 changes: 2 additions & 0 deletions test/nested.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var falafel = require('falafel');
var tape = require('../');
var tap = require('tap');
Expand Down
Loading

0 comments on commit 11b7d85

Please sign in to comment.