From c78091d689d0d4d56b3231b9050d52ca69ecb449 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 1 Oct 2015 21:37:12 -0700 Subject: [PATCH] test: load common.js in all tests 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: https://github.com/nodejs/node/pull/3157 Reviewed-By: Rod Vagg Reviewed-By: Colin Ihrig --- test/addons/async-hello-world/test.js | 1 + test/addons/at-exit/test.js | 1 + test/addons/heap-profiler/test.js | 2 ++ test/addons/hello-world-function-export/test.js | 1 + test/addons/hello-world/test.js | 1 + test/addons/repl-domain-abort/test.js | 1 + test/debugger/test-debugger-repl-break-in-module.js | 1 + test/debugger/test-debugger-repl-restart.js | 1 + test/debugger/test-debugger-repl-term.js | 1 + test/debugger/test-debugger-repl.js | 1 + 10 files changed, 11 insertions(+) diff --git a/test/addons/async-hello-world/test.js b/test/addons/async-hello-world/test.js index a284a019f0..14b80b711b 100644 --- a/test/addons/async-hello-world/test.js +++ b/test/addons/async-hello-world/test.js @@ -1,4 +1,5 @@ 'use strict'; +require('../../common'); var assert = require('assert'); var binding = require('./build/Release/binding'); var called = false; diff --git a/test/addons/at-exit/test.js b/test/addons/at-exit/test.js index c36f59b976..32264a6604 100644 --- a/test/addons/at-exit/test.js +++ b/test/addons/at-exit/test.js @@ -1,2 +1,3 @@ 'use strict'; +require('../../common'); var binding = require('./build/Release/binding'); diff --git a/test/addons/heap-profiler/test.js b/test/addons/heap-profiler/test.js index a4a316fa57..3fa00e9b86 100644 --- a/test/addons/heap-profiler/test.js +++ b/test/addons/heap-profiler/test.js @@ -1,5 +1,7 @@ 'use strict'; +require('../../common'); + const binding = require('./build/Release/binding'); // Create an AsyncWrap object. diff --git a/test/addons/hello-world-function-export/test.js b/test/addons/hello-world-function-export/test.js index 1056386583..6dcdf39ce1 100644 --- a/test/addons/hello-world-function-export/test.js +++ b/test/addons/hello-world-function-export/test.js @@ -1,4 +1,5 @@ 'use strict'; +require('../../common'); var assert = require('assert'); var binding = require('./build/Release/binding'); assert.equal('world', binding()); diff --git a/test/addons/hello-world/test.js b/test/addons/hello-world/test.js index c0492292fd..5637e9e6e9 100644 --- a/test/addons/hello-world/test.js +++ b/test/addons/hello-world/test.js @@ -1,4 +1,5 @@ 'use strict'; +require('../../common'); var assert = require('assert'); var binding = require('./build/Release/binding'); assert.equal('world', binding.hello()); diff --git a/test/addons/repl-domain-abort/test.js b/test/addons/repl-domain-abort/test.js index a520df0380..1268b61f36 100644 --- a/test/addons/repl-domain-abort/test.js +++ b/test/addons/repl-domain-abort/test.js @@ -1,4 +1,5 @@ 'use strict'; +require('../../common'); var assert = require('assert'); var repl = require('repl'); var stream = require('stream'); diff --git a/test/debugger/test-debugger-repl-break-in-module.js b/test/debugger/test-debugger-repl-break-in-module.js index 995f6fe0db..e3f998eb64 100644 --- a/test/debugger/test-debugger-repl-break-in-module.js +++ b/test/debugger/test-debugger-repl-break-in-module.js @@ -1,4 +1,5 @@ 'use strict'; +require('../common'); var repl = require('./helper-debugger-repl.js'); repl.startDebugger('break-in-module/main.js'); diff --git a/test/debugger/test-debugger-repl-restart.js b/test/debugger/test-debugger-repl-restart.js index d3b2c169de..584cb098bf 100644 --- a/test/debugger/test-debugger-repl-restart.js +++ b/test/debugger/test-debugger-repl-restart.js @@ -1,4 +1,5 @@ 'use strict'; +require('../common'); var repl = require('./helper-debugger-repl.js'); repl.startDebugger('breakpoints.js'); diff --git a/test/debugger/test-debugger-repl-term.js b/test/debugger/test-debugger-repl-term.js index 741adf682a..6872f6ce2f 100644 --- a/test/debugger/test-debugger-repl-term.js +++ b/test/debugger/test-debugger-repl-term.js @@ -1,4 +1,5 @@ 'use strict'; +require('../common'); process.env.NODE_FORCE_READLINE = 1; var repl = require('./helper-debugger-repl.js'); diff --git a/test/debugger/test-debugger-repl.js b/test/debugger/test-debugger-repl.js index 2e44da55d7..f93570c501 100644 --- a/test/debugger/test-debugger-repl.js +++ b/test/debugger/test-debugger-repl.js @@ -1,4 +1,5 @@ 'use strict'; +require('../common'); var repl = require('./helper-debugger-repl.js'); repl.startDebugger('breakpoints.js');