diff --git a/test/addons/not-a-binding/binding.gyp b/test/addons/not-a-binding/binding.gyp new file mode 100644 index 00000000000000..7ddad59c1d1683 --- /dev/null +++ b/test/addons/not-a-binding/binding.gyp @@ -0,0 +1,8 @@ +{ + 'targets': [ + { + 'target_name': 'binding', + 'sources': [ 'not_a_binding.c' ] + } + ] +} diff --git a/test/addons/not-a-binding/not_a_binding.c b/test/addons/not-a-binding/not_a_binding.c new file mode 100644 index 00000000000000..af8791a1e3479c --- /dev/null +++ b/test/addons/not-a-binding/not_a_binding.c @@ -0,0 +1,3 @@ +int foo(void) { + return 0; +} diff --git a/test/addons/not-a-binding/test.js b/test/addons/not-a-binding/test.js new file mode 100644 index 00000000000000..a0ce2d0629ac1d --- /dev/null +++ b/test/addons/not-a-binding/test.js @@ -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);