Skip to content

Commit

Permalink
[WIP] Test: Enable skipped CLI tests on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Krinkle committed Apr 10, 2024
1 parent 2a7eea1 commit cf3f766
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
27 changes: 9 additions & 18 deletions test/cli/cli-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { execute, concurrentMapKeys } = require('./helpers/execute.js');
const { readFixtures } = require('./helpers/fixtures.js');

const FIXTURES_DIR = path.join(__dirname, 'fixtures');
const skipOnWinTest = (process.platform === 'win32' ? 'skip' : 'test');
const skipOnWinTest = 'test';

QUnit.module('CLI Main', () => {
QUnit.test.each('fixtures',
Expand All @@ -21,8 +21,7 @@ QUnit.module('CLI Main', () => {
}
);

// TODO: Figure out why trace isn't trimmed on Windows. https://github.com/qunitjs/qunit/issues/1359
QUnit[skipOnWinTest]('report assert.throws() failures properly', async assert => {
QUnit.test('report assert.throws() failures properly', async assert => {
const command = ['qunit', 'assert-throws-failure.js'];
const execution = await execute(command);
assert.equal(execution.snapshot, `TAP version 13
Expand Down Expand Up @@ -237,8 +236,7 @@ ok 1 ESM test suite > sum()

// https://nodejs.org/dist/v12.12.0/docs/api/cli.html#cli_enable_source_maps
if (semver.gte(process.versions.node, '14.0.0')) {
// TODO: Figure out why trace isn't trimmed on Windows. https://github.com/qunitjs/qunit/issues/1359
QUnit[skipOnWinTest]('normal trace with native source map', async assert => {
QUnit.test('normal trace with native source map', async assert => {
const command = ['qunit', 'sourcemap/source.js'];
const execution = await execute(command);

Expand All @@ -264,9 +262,7 @@ not ok 2 Example > bad

// skip if running in code coverage mode,
// as that leads to conflicting maps-on-maps that invalidate this test
//
// TODO: Figure out why trace isn't trimmed on Windows. https://github.com/qunitjs/qunit/issues/1359
QUnit[process.env.NYC_PROCESS_ID ? 'skip' : skipOnWinTest](
QUnit[process.env.NYC_PROCESS_ID ? 'skip' : 'test'](
'mapped trace with native source map', async function (assert) {
const command = ['qunit', 'sourcemap/source.min.js'];
const execution = await execute(command, {
Expand Down Expand Up @@ -398,8 +394,7 @@ not ok 1 global failure
});
});

// TODO: Figure out why trace isn't trimmed on Windows. https://github.com/qunitjs/qunit/issues/1359
QUnit[skipOnWinTest]('assert.async() handled after fail in other test', async assert => {
QUnit.test('assert.async() handled after fail in other test', async assert => {
const command = ['qunit', 'drooling-done.js'];
const execution = await execute(command);

Expand Down Expand Up @@ -427,8 +422,7 @@ ok 2 Test B
# exit code: 1`);
});

// TODO: Figure out why trace isn't trimmed on Windows. https://github.com/qunitjs/qunit/issues/1359
QUnit[skipOnWinTest]('assert.async() handled again in other test', async assert => {
QUnit.test('assert.async() handled again in other test', async assert => {
const command = ['qunit', 'drooling-extra-done.js'];
const execution = await execute(command);

Expand Down Expand Up @@ -457,8 +451,7 @@ not ok 2 Test B
# exit code: 1`);
});

// TODO: Figure out why trace isn't trimmed on Windows. https://github.com/qunitjs/qunit/issues/1359
QUnit[skipOnWinTest]('assert.async() handled too often', async assert => {
QUnit.test('assert.async() handled too often', async assert => {
const command = ['qunit', 'too-many-done-calls.js'];
const execution = await execute(command);

Expand Down Expand Up @@ -486,8 +479,7 @@ not ok 1 Test A
# exit code: 1`);
});

// TODO: Figure out why trace isn't trimmed on Windows. https://github.com/qunitjs/qunit/issues/1359
QUnit[skipOnWinTest]('module.only() nested', async assert => {
QUnit.test('module.only() nested', async assert => {
const command = ['qunit', 'only-module.js'];
const execution = await execute(command);

Expand All @@ -513,8 +505,7 @@ ok 6 module E > test E
# fail 0`);
});

// TODO: Figure out why trace isn't trimmed on Windows. https://github.com/qunitjs/qunit/issues/1359
QUnit[skipOnWinTest]('module.only() flat', async assert => {
QUnit.test('module.only() flat', async assert => {
const command = ['qunit', 'only-module-flat.js'];
const execution = await execute(command);

Expand Down
2 changes: 1 addition & 1 deletion test/cli/helpers/execute.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async function execute (command, options = {}, hook) {

// Avoid Windows-specific issue where otherwise 'foo/bar' is seen as a directory
// named "'foo/" (including the single quote).
options.windowsVerbatimArguments = true;
// options.windowsVerbatimArguments = true;

let cmd = command[0];
const args = command.slice(1);
Expand Down

0 comments on commit cf3f766

Please sign in to comment.