0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-common-gc.js
James M Snell d495e40bf7
test: move common.onGC to individual module
Incrementally making `require('../common')` less of a monolith.
Move the `common.onGC()` utility to a separate standalone module
that is only imported when it's actually needed.

PR-URL: https://github.com/nodejs/node/pull/22446
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-08-24 10:32:09 -07:00

15 lines
243 B
JavaScript

'use strict';
// Flags: --expose-gc
const common = require('../common');
const onGC = require('../common/ongc');
{
onGC({}, { ongc: common.mustCall() });
global.gc();
}
{
onGC(process, { ongc: common.mustNotCall() });
global.gc();
}