Skip to content

Commit 3970ca9

Browse files
committed
fixup! test: split test-runner-watch-mode-kill-signal
1 parent 3ad523c commit 3970ca9

File tree

6 files changed

+22
-20
lines changed

6 files changed

+22
-20
lines changed

test/common/index.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -913,20 +913,6 @@ function expectRequiredTLAError(err) {
913913
}
914914
}
915915

916-
function skipIfNoWatchModeSignals() {
917-
if (exports.isWindows) {
918-
skip('no signals on Windows');
919-
}
920-
921-
if (exports.isIBMi) {
922-
skip('IBMi does not support `fs.watch()`');
923-
}
924-
925-
if (exports.isAIX) {
926-
skip('folder watch capability is limited in AIX.');
927-
}
928-
}
929-
930916
const common = {
931917
allowGlobals,
932918
buildType,
@@ -974,7 +960,6 @@ const common = {
974960
skipIf32Bits,
975961
skipIfEslintMissing,
976962
skipIfInspectorDisabled,
977-
skipIfNoWatchModeSignals,
978963
skipIfSQLiteMissing,
979964
spawnPromisified,
980965

test/common/index.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ const {
4646
skipIf32Bits,
4747
skipIfEslintMissing,
4848
skipIfInspectorDisabled,
49-
skipIfNoWatchModeSignals,
5049
skipIfSQLiteMissing,
5150
spawnPromisified,
5251
} = common;
@@ -98,7 +97,6 @@ export {
9897
skipIf32Bits,
9998
skipIfEslintMissing,
10099
skipIfInspectorDisabled,
101-
skipIfNoWatchModeSignals,
102100
skipIfSQLiteMissing,
103101
spawnPromisified,
104102
};

test/common/watch.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
'use strict';
2+
const common = require('./index.js');
3+
4+
exports.skipIfNoWatchModeSignals = function() {
5+
if (common.isWindows) {
6+
common.skip('no signals on Windows');
7+
}
8+
9+
if (common.isIBMi) {
10+
common.skip('IBMi does not support `fs.watch()`');
11+
}
12+
13+
if (common.isAIX) {
14+
common.skip('folder watch capability is limited in AIX.');
15+
}
16+
};

test/parallel/test-watch-mode-kill-signal-default.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
// Test that the kill signal sent by --watch defaults to SIGTERM.
22

3-
import { skipIfNoWatchModeSignals } from '../common/index.mjs';
3+
import '../common/index.mjs';
44
import assert from 'node:assert';
55
import { writeFileSync } from 'node:fs';
66
import { spawn } from 'node:child_process';
77
import { once } from 'node:events';
88
import tmpdir from '../common/tmpdir.js';
99
import fixtures from '../common/fixtures.js';
10+
import { skipIfNoWatchModeSignals } from '../common/watch.js';
1011

1112
skipIfNoWatchModeSignals();
1213

test/parallel/test-watch-mode-kill-signal-invalid.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
// Test that --watch-kill-signal errors when an invalid kill signal is provided.
22

3-
import { skipIfNoWatchModeSignals } from '../common/index.mjs';
3+
import '../common/index.mjs';
44
import assert from 'node:assert';
55
import { writeFileSync } from 'node:fs';
66
import { spawn } from 'node:child_process';
77
import tmpdir from '../common/tmpdir.js';
88
import fixtures from '../common/fixtures.js';
9+
import { skipIfNoWatchModeSignals } from '../common/watch.js';
910

1011
skipIfNoWatchModeSignals();
1112

test/parallel/test-watch-mode-kill-signal-override.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
// Test that the kill signal sent by --watch can be overridden to SIGINT
22
// by using --watch-kill-signal.
33

4-
import { skipIfNoWatchModeSignals } from '../common/index.mjs';
4+
import '../common/index.mjs';
55
import assert from 'node:assert';
66
import { writeFileSync } from 'node:fs';
77
import { spawn } from 'node:child_process';
88
import { once } from 'node:events';
99
import tmpdir from '../common/tmpdir.js';
1010
import fixtures from '../common/fixtures.js';
11+
import { skipIfNoWatchModeSignals } from '../common/watch.js';
1112

1213
skipIfNoWatchModeSignals();
1314

0 commit comments

Comments
 (0)