Skip to content

Commit cf41cb0

Browse files
committed
fixup: add explicit test for GH 21918
1 parent 1154edc commit cf41cb0

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/parallel/test-preload.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,26 @@ childProcess.exec(
132132
}
133133
);
134134

135+
// test that preloading with a relative path works
136+
process.chdir(fixtures.fixturesDir);
137+
childProcess.exec(
138+
`"${nodeBinary}" ${preloadOption(['./printA.js'])} "${fixtureB}"`,
139+
common.mustCall(function(err, stdout, stderr) {
140+
assert.ifError(err);
141+
assert.strictEqual(stdout, 'A\nB\n');
142+
})
143+
);
144+
if (common.isWindows) {
145+
// https://github.com/nodejs/node/issues/21918
146+
childProcess.exec(
147+
`"${nodeBinary}" ${preloadOption(['.\\printA.js'])} "${fixtureB}"`,
148+
common.mustCall(function(err, stdout, stderr) {
149+
assert.ifError(err);
150+
assert.strictEqual(stdout, 'A\nB\n');
151+
})
152+
);
153+
}
154+
135155
// https://github.com/nodejs/node/issues/1691
136156
process.chdir(fixtures.fixturesDir);
137157
childProcess.exec(

0 commit comments

Comments
 (0)