Skip to content
Closed
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
test: add check on an addon that doesn't register
This commit calls require on a shared library that is
not declared as a node module, and therefore does not register
properly.

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
  • Loading branch information
ezequielgarcia committed Jun 30, 2017
commit 1db783690bdb13eee1f58bd18c129bc6bfb846f0
8 changes: 8 additions & 0 deletions test/addons/not-a-binding/binding.gyp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
'targets': [
{
'target_name': 'binding',
'sources': [ 'not_a_binding.c' ]
}
]
}
3 changes: 3 additions & 0 deletions test/addons/not-a-binding/not_a_binding.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int foo(void) {
return 0;
}
6 changes: 6 additions & 0 deletions test/addons/not-a-binding/test.js
Original file line number Diff line number Diff line change
@@ -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);