Skip to content

Commit e5375a9

Browse files
ezequielgarciaMylesBorins
authored andcommitted
test: add check on an addon that does not register
This commit calls require on a shared library that is not declared as a node module, and therefore does not register properly. PR-URL: #13954 Signed-off-by: Ezequiel Garcia <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 39f6240 commit e5375a9

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

test/addons/not-a-binding/binding.gyp

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
'targets': [
3+
{
4+
'target_name': 'binding',
5+
'sources': [ 'not_a_binding.c' ]
6+
}
7+
]
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
int foo(void) {
2+
return 0;
3+
}

test/addons/not-a-binding/test.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
'use strict';
2+
const common = require('../../common');
3+
const assert = require('assert');
4+
5+
const re = /^Error: Module did not self-register\.$/;
6+
assert.throws(() => require(`./build/${common.buildType}/binding`), re);

0 commit comments

Comments
 (0)