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: https://github.com/nodejs/node/pull/13954 Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This commit is contained in:
parent
bdfbce9241
commit
13d6eae5f3
8
test/addons/not-a-binding/binding.gyp
Normal file
8
test/addons/not-a-binding/binding.gyp
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'binding',
|
||||
'sources': [ 'not_a_binding.c' ]
|
||||
}
|
||||
]
|
||||
}
|
3
test/addons/not-a-binding/not_a_binding.c
Normal file
3
test/addons/not-a-binding/not_a_binding.c
Normal file
@ -0,0 +1,3 @@
|
||||
int foo(void) {
|
||||
return 0;
|
||||
}
|
6
test/addons/not-a-binding/test.js
Normal file
6
test/addons/not-a-binding/test.js
Normal file
@ -0,0 +1,6 @@
|
||||
'use strict';
|
||||
const common = require('../../common');
|
||||
const assert = require('assert');
|
||||
|
||||
const re = /^Error: Module did not self-register\.$/;
|
||||
assert.throws(() => require(`./build/${common.buildType}/binding`), re);
|
Loading…
x
Reference in New Issue
Block a user