node/test/fixtures/leakedGlobal.js
Rich Trott 2b29df71eb test: do not export common.leakedGlobals()
common.leakedGlobals() was exposed only to test its logic. The logic can
instead be tested by running a fixture file that leaks a global and
seeing if `common` causes an AssertionError on exit. This way, the
entire functionality of leak detection is tested rather than just the
leakedGlobals() function. It also reduces API surface area for the
common monolith by one function.

PR-URL: https://github.com/nodejs/node/pull/22965
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-09-21 19:20:26 -07:00

6 lines
85 B
JavaScript

'use strict';
require('../common');
global.gc = 42; // intentionally leak a global