Skip to content
Myr

Windows tests (and GitHub Actions) (#1070)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* Use separatr run commands to work-around Windows issue * Restrict tests while fixing Windows failures * Skip signal tests on Windows * Get platform without needing extra require * Make tests runnable on WIndows * Use node explicitly for compatibility with WIndows * Name conditional more explicitly * Suppress test that fails differently on WIndows * Missing executable subcommand fails without tidy message on Windows * Remove test for non-executable launch failure, different behaviours on node 8 vs 10, and Windows * Minor code tidy * Skip symlink tests on Windows * Fix lint call, and restore full matrix

authored by John Gee · committed by Tomoaki Abe · parent a92da62 · Browse files · 5 files+57 added−44 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+57 added−44 removed

  • tests:+50 added−39 removed
  • other:+7 added−5 removed

5 files+57 added−44 removed

modified:.github/workflows/tests.yml+7 added-5 removed
modified:tests/command.executableSubcommand.default.test.js+6 added-4 removed
modified:tests/command.executableSubcommand.lookup.test.js+33 added-32 removed
modified:tests/command.executableSubcommand.signals.test.js+7 added-2 removed
modified:tests/command.exitOverride.test.js+4 added-1 removed
11 unmodified lines
12 expect(err.code).toBe(code);13 expect(err.message).toBe(message);14}1516const testOrSkipOnWindows = (process.platform === 'win32') ? test.skip : test;1718describe('.exitOverride and error details', () => {19 // Use internal knowledge to suppress output to keep test output clean.20 let consoleErrorSpy;21 let writeSpy;
167 unmodified lines
189190 program.parse(['node', pm, 'silent']);191 });192193 // Throws directly on Windows191 test('when executableSubcommand fails then call exitOverride', (done) => {194 testOrSkipOnWindows('when executableSubcommand fails then call exitOverride', (done) => {195 // Tricky for override, get called for `error` event then `exit` event.196 const exitCallback = jest.fn()197 .mockImplementationOnce((err) => {198 expectCommanderError(err, 1, 'commander.executeSubCommandAsync', '(error)');
15 unmodified lines