Skip to content

Commit f1672cc

Browse files
committed
Address comments
1 parent 9971c71 commit f1672cc

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

test/test-native-loader.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,27 @@ describe('NativeLoader testing', function () {
8181
assert.ok(existsSync.called);
8282
const args = existsSync.lastCall.args[0];
8383
assert.ok(args.includes('humble'));
84+
assert.ok(args.includes('-node-'));
85+
assert.ok(args.includes('rclnodejs.node'));
86+
});
87+
88+
it('customFallbackLoader includes electron runtime in exact match path', function () {
89+
if (process.platform === 'win32') {
90+
this.skip();
91+
}
92+
93+
Object.defineProperty(process, 'platform', { value: 'linux' });
94+
Object.defineProperty(process, 'arch', { value: 'x64' });
95+
process.env.ROS_DISTRO = 'humble';
96+
process.env.npm_config_runtime = 'electron';
97+
98+
const existsSync = sandbox.stub(fs, 'existsSync').returns(true);
99+
assert.strictEqual(loader.customFallbackLoader(), null);
100+
101+
assert.ok(existsSync.called);
102+
const args = existsSync.lastCall.args[0];
103+
assert.ok(args.includes('humble'));
104+
assert.ok(args.includes('-electron-'));
84105
assert.ok(args.includes('rclnodejs.node'));
85106
});
86107

0 commit comments

Comments
 (0)