Skip to content

Commit

Permalink
Test: End-to-end test for .mjs and .js default file extensions
Browse files Browse the repository at this point in the history
Follows-up 6f72eeb.
  • Loading branch information
Krinkle committed Jan 18, 2025
1 parent 166b346 commit 53ee0a7
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 19 deletions.
2 changes: 1 addition & 1 deletion test/cli/cli-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Bail out! Error: No tests matched the filter "no matches".
});

QUnit.test('--seed=true generates new random seed', async assert => {
const command = ['qunit', '--seed', 'true', 'basic-one.js', 'test/'];
const command = ['qunit', '--seed', 'true', 'basic-one.js', 'test/first.js', 'test/nested/'];
const execution = await execute(command);

const actualHarness = execution.snapshot
Expand Down
10 changes: 6 additions & 4 deletions test/cli/fixtures/_load-default.tap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
# command: ["qunit"]

TAP version 13
ok 1 First > 1
ok 2 Second > 1
1..2
# pass 2
ok 1 Extension CJS > example
ok 2 Extension MJS > example
ok 3 First > 1
ok 4 Second > 1
1..4
# pass 4
# skip 0
# todo 0
# fail 0
10 changes: 6 additions & 4 deletions test/cli/fixtures/_load-dir-file-glob.tap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ TAP version 13
ok 1 Single > has a test
ok 2 A-Test > derp
ok 3 Nested-Test > herp
ok 4 First > 1
ok 5 Second > 1
1..5
# pass 5
ok 4 Extension CJS > example
ok 5 Extension MJS > example
ok 6 First > 1
ok 7 Second > 1
1..7
# pass 7
# skip 0
# todo 0
# fail 0
10 changes: 6 additions & 4 deletions test/cli/fixtures/_load-dir.tap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
# command: ["qunit","test"]

TAP version 13
ok 1 First > 1
ok 2 Second > 1
1..2
# pass 2
ok 1 Extension CJS > example
ok 2 Extension MJS > example
ok 3 First > 1
ok 4 Second > 1
1..4
# pass 4
# skip 0
# todo 0
# fail 0
14 changes: 8 additions & 6 deletions test/cli/fixtures/seed.tap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
Running tests with seed: s33d
TAP version 13
ok 1 Second > 1
ok 2 Nested-Test > herp
ok 3 First > 1
ok 4 A-Test > derp
ok 5 Single > has a test
1..5
# pass 5
ok 2 Extension MJS > example
ok 3 Nested-Test > herp
ok 4 Extension CJS > example
ok 5 A-Test > derp
ok 6 First > 1
ok 7 Single > has a test
1..7
# pass 7
# skip 0
# todo 0
# fail 0
5 changes: 5 additions & 0 deletions test/cli/fixtures/test/extension.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
QUnit.module('Extension CJS', function () {
QUnit.test('example', function (assert) {
assert.true(true);
});
});
5 changes: 5 additions & 0 deletions test/cli/fixtures/test/extension.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
QUnit.module('Extension MJS', function () {
QUnit.test('example', function (assert) {
assert.true(true);
});
});
1 change: 1 addition & 0 deletions test/cli/fixtures/test/extension.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
throw new Error('Directory scan should not load TS by default.');
1 change: 1 addition & 0 deletions test/cli/fixtures/test/extension.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Directory scan should not load TXT by default.

0 comments on commit 53ee0a7

Please sign in to comment.