Skip to content

Commit

Permalink
test: Convert memory-leak test cases to .tap.txt fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
Krinkle committed Nov 24, 2024
1 parent e35befa commit 58f07e2
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 40 deletions.
40 changes: 0 additions & 40 deletions test/cli/cli-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,46 +103,6 @@ not ok 2 Example > bad
# exit code: 1`);
});

// TODO: Move to /test/cli/fixtures/
QUnit.test('memory-leak/module-closure [unfiltered]', async assert => {
const command = ['node', '--expose-gc', '../../../bin/qunit.js', 'memory-leak/module-closure.js'];
const execution = await execute(command);
assert.equal(execution.snapshot, `TAP version 13
ok 1 module-closure > example test
ok 2 module-closure > example child module > example child module test
ok 3 module-closure check > memory release
1..3
# pass 3
# skip 0
# todo 0
# fail 0`);
});

QUnit.test('memory-leak/module-closure [filtered module]', async assert => {
const command = ['node', '--expose-gc', '../../../bin/qunit.js', '--filter', '!child', 'memory-leak/module-closure.js'];
const execution = await execute(command);
assert.equal(execution.snapshot, `TAP version 13
ok 1 module-closure > example test
ok 2 module-closure check > memory release
1..2
# pass 2
# skip 0
# todo 0
# fail 0`);
});

QUnit.test('memory-leak/test-object', async assert => {
const command = ['node', '--expose-gc', '../../../bin/qunit.js', 'memory-leak/test-object.js'];
const execution = await execute(command);
assert.equal(execution.snapshot, `TAP version 13
ok 1 test-object > example test
1..1
# pass 1
# skip 0
# todo 0
# fail 0`);
});

QUnit.test.if('tap pipe [pass]', !isWindows, async assert => {
const command = 'qunit basic-one.js | ../../../node_modules/.bin/tap-min';
const execution = await executeRaw(command);
Expand Down
11 changes: 11 additions & 0 deletions test/cli/fixtures/memory-leak-module-closure-filtered.tap.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# name: memory leak module-closure filtered
# command: ["node", "--expose-gc", "../../../bin/qunit.js", "--filter", "!child", "memory-leak-module-closure.js"]

TAP version 13
ok 1 module-closure > example test
ok 2 module-closure check > memory release
1..2
# pass 2
# skip 0
# todo 0
# fail 0
12 changes: 12 additions & 0 deletions test/cli/fixtures/memory-leak-module-closure-unfiltered.tap.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# name: memory leak module-closure unfiltered
# command: ["node", "--expose-gc", "../../../bin/qunit.js", "memory-leak-module-closure.js"]

TAP version 13
ok 1 module-closure > example test
ok 2 module-closure > example child module > example child module test
ok 3 module-closure check > memory release
1..3
# pass 3
# skip 0
# todo 0
# fail 0
10 changes: 10 additions & 0 deletions test/cli/fixtures/memory-leak-test-object.tap.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# name: memory leak test-object
# command: ["node", "--expose-gc", "../../../bin/qunit.js", "memory-leak-test-object.js"]

TAP version 13
ok 1 test-object > example test
1..1
# pass 1
# skip 0
# todo 0
# fail 0

0 comments on commit 58f07e2

Please sign in to comment.