Skip to content

Commit

Permalink
test: load common.js in all tests
Browse files Browse the repository at this point in the history
common.js contains code that detects leaked variables.

In preparation for an eslint rule that will enforce loading common.js in
test files, load it everywhere it can be loaded and use an
`eslint-disable` comment for files that intentionally leak.

PR-URL: #3157
Reviewed-By: Rod Vagg <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
Trott authored and jasnell committed Oct 8, 2015
1 parent 5d9f83f commit b717956
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/addons/async-hello-world/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';
require('../../common');
var assert = require('assert');
var binding = require('./build/Release/binding');
var called = false;
Expand Down
1 change: 1 addition & 0 deletions test/addons/at-exit/test.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
'use strict';
require('../../common');
var binding = require('./build/Release/binding');
2 changes: 2 additions & 0 deletions test/addons/heap-profiler/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict';

require('../../common');

const binding = require('./build/Release/binding');

// Create an AsyncWrap object.
Expand Down
1 change: 1 addition & 0 deletions test/addons/hello-world-function-export/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';
require('../../common');
var assert = require('assert');
var binding = require('./build/Release/binding');
assert.equal('world', binding());
Expand Down
1 change: 1 addition & 0 deletions test/addons/hello-world/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';
require('../../common');
var assert = require('assert');
var binding = require('./build/Release/binding');
assert.equal('world', binding.hello());
Expand Down
1 change: 1 addition & 0 deletions test/addons/repl-domain-abort/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';
require('../../common');
var assert = require('assert');
var repl = require('repl');
var stream = require('stream');
Expand Down
1 change: 1 addition & 0 deletions test/debugger/test-debugger-repl-break-in-module.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';
require('../common');
var repl = require('./helper-debugger-repl.js');

repl.startDebugger('break-in-module/main.js');
Expand Down
1 change: 1 addition & 0 deletions test/debugger/test-debugger-repl-restart.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';
require('../common');
var repl = require('./helper-debugger-repl.js');

repl.startDebugger('breakpoints.js');
Expand Down
1 change: 1 addition & 0 deletions test/debugger/test-debugger-repl-term.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';
require('../common');
process.env.NODE_FORCE_READLINE = 1;

var repl = require('./helper-debugger-repl.js');
Expand Down
1 change: 1 addition & 0 deletions test/debugger/test-debugger-repl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';
require('../common');
var repl = require('./helper-debugger-repl.js');

repl.startDebugger('breakpoints.js');
Expand Down

0 comments on commit b717956

Please sign in to comment.