Skip to content

Commit f503f06

Browse files
committed
Test: Rename memory-leak fixture
1 parent 589d9ed commit f503f06

File tree

3 files changed

+17
-19
lines changed

3 files changed

+17
-19
lines changed

test/cli/cli-main.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -302,17 +302,15 @@ HOOK: BCD1 @ B after`;
302302
// https://nodejs.org/docs/v14.0.0/api/v8.html#v8_v8_getheapsnapshot
303303
// Created in Node 11.x, but starts working the way we need from Node 14.
304304
if (semver.gte(process.versions.node, '14.0.0')) {
305-
QUnit.test('callbacks and hooks from modules are properly released for garbage collection', async assert => {
306-
const command = ['node', '--expose-gc', '../../../bin/qunit.js', 'memory-leak/*.js'];
305+
QUnit.test('memory-leak/module-closure [unfiltered]', async assert => {
306+
const command = ['node', '--expose-gc', '../../../bin/qunit.js', 'memory-leak/module-closure.js'];
307307
const execution = await execute(command);
308-
309308
assert.equal(execution.snapshot, getExpected(command));
310309
});
311310

312-
QUnit.test('callbacks and hooks from filtered-out modules are properly released for garbage collection', async assert => {
313-
const command = ['node', '--expose-gc', '../../../bin/qunit.js', '--filter', '!child', 'memory-leak/*.js'];
311+
QUnit.test('memory-leak/module-closure [filtered module]', async assert => {
312+
const command = ['node', '--expose-gc', '../../../bin/qunit.js', '--filter', '!child', 'memory-leak/module-closure.js'];
314313
const execution = await execute(command);
315-
316314
assert.equal(execution.snapshot, getExpected(command));
317315
});
318316
}

test/cli/fixtures/expected/tap-outputs.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -446,21 +446,21 @@ ok 1 Single > has a test
446446
# todo 0
447447
# fail 0`,
448448

449-
"node --expose-gc ../../../bin/qunit.js 'memory-leak/*.js'":
449+
"node --expose-gc ../../../bin/qunit.js memory-leak/module-closure.js":
450450
`TAP version 13
451-
ok 1 some nested module > can call method on foo
452-
ok 2 some nested module > child module > child test
453-
ok 3 later thing > has released all foos
451+
ok 1 module-closure > example test
452+
ok 2 module-closure > example child module > example child module test
453+
ok 3 module-closure check > memory release
454454
1..3
455455
# pass 3
456456
# skip 0
457457
# todo 0
458458
# fail 0`,
459459

460-
"node --expose-gc ../../../bin/qunit.js --filter !child 'memory-leak/*.js'":
460+
"node --expose-gc ../../../bin/qunit.js --filter !child memory-leak/module-closure.js":
461461
`TAP version 13
462-
ok 1 some nested module > can call method on foo
463-
ok 2 later thing > has released all foos
462+
ok 1 module-closure > example test
463+
ok 2 module-closure check > memory release
464464
1..2
465465
# pass 2
466466
# skip 0

test/cli/fixtures/memory-leak/index.js renamed to test/cli/fixtures/memory-leak/module-closure.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function streamToString (stream) {
2727
});
2828
}
2929

30-
QUnit.module('some nested module', function (hooks) {
30+
QUnit.module('module-closure', function (hooks) {
3131
let foo1, foo2;
3232

3333
hooks.beforeEach(function () {
@@ -40,25 +40,25 @@ QUnit.module('some nested module', function (hooks) {
4040
assert.equal(foo2.getId(), 'FooNum');
4141
});
4242

43-
QUnit.test('can call method on foo', function (assert) {
43+
QUnit.test('example test', function (assert) {
4444
assert.equal(foo1.getId(), 'FooNum');
4545
});
4646

47-
QUnit.module('child module', function (hooks) {
47+
QUnit.module('example child module', function (hooks) {
4848
let foo3;
4949

5050
hooks.beforeEach(function () {
5151
foo3 = foo1;
5252
});
5353

54-
QUnit.test('child test', function (assert) {
54+
QUnit.test('example child module test', function (assert) {
5555
assert.ok(foo3);
5656
});
5757
});
5858
});
5959

60-
QUnit.module('later thing', function () {
61-
QUnit.test('has released all foos', async function (assert) {
60+
QUnit.module('module-closure check', function () {
61+
QUnit.test('memory release', async function (assert) {
6262
// The snapshot is expected to contain entries like this:
6363
// > "FooNum<integer>"
6464
// It is important that the regex uses \d and that the above

0 commit comments

Comments
 (0)