Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/util/abi_crosswalk.json
Original file line number Diff line number Diff line change
Expand Up @@ -3131,4 +3131,4 @@
"node_abi": 127,
"v8": "12.4"
}
}
}
20 changes: 20 additions & 0 deletions test/versioning.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,26 @@ test('should detect abi for node-webkit runtime', (t) => {
t.end();
});

test('should throw when custom node target is not found in abi_crosswalk file', (t) => {
try {
versioning.get_runtime_abi('node', '123456789.0.0');
} catch (e) {
const expectedMessage = 'Unsupported target version: 123456789.0.0';
t.equal(e.message, expectedMessage);
t.end();
}
});

test('should throw when custom node target is not semver', (t) => {
try {
versioning.get_runtime_abi('node', '1.2.3.4');
} catch (e) {
const expectedMessage = 'Unknown target version: 1.2.3.4';
t.equal(e.message, expectedMessage);
t.end();
}
});

test('should detect custom binary host from env', (t) => {
const mock_package_json = {
'name': 'test',
Expand Down