Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[test] update test case for building native modules(node-dtrace-provider... #1398

Merged
merged 2 commits into from

2 participants

@kingFighter

..., ref, node-lame)

@rogerwang
Owner

I see you're writing test code for each of the module. Is there a common way to check whether the module is loaded?

@kingFighter

@rogerwang I tried with Object.keys(require('module')._cache); & module.loaded; , but not work.
I think var m = require('module') & typeof m == 'object' is enough.

@rogerwang
Owner

please update your code.

@rogerwang rogerwang merged commit 96bb148 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 16, 2013
  1. @kingFighter
Commits on Dec 19, 2013
  1. @kingFighter
This page is out of date. Refresh to see the latest.
View
8 tests/automatic_tests/node/mocha_test.js
@@ -143,7 +143,13 @@ describe('module', function() {
});
it('native modules without handle scope', function() {
- require('./node_modules/nw_test_loop_without_handle');
+ require('./node_modules/nw_test_loop_without_handle');
+ });
+
+ it('native modules should work', function() {
+ var nativeModules = new Array("dtrace-provider", "ref", "lame");
+ for (var i = 0; i < nativeModules.length; i++)
+ assert.equal((typeof require(nativeModules[i])), "object");
});
});
});
View
3  tests/package.json
@@ -20,6 +20,9 @@
"mocha": "1.7.4",
"nw_test_loop": "git+https://github.com/owenc4a4/nw_test_loop_without_handle.git",
"bignum": "git+https://github.com/owenc4a4/bignum.git",
+ "node-dtrace-provider": "git+https://github.com/chrisa/node-dtrace-provider.git",
+ "ref": "git+https://github.com/TooTallNate/ref.git",
+ "node-lame": "git+https://github.com/TooTallNate/node-lame.git",
"fs-extra": "*"
},
"user-agent": "%name/%nwver/%ver/%webkit_ver/%osinfo",
View
3  tools/build_native_modules.py
@@ -4,6 +4,9 @@
native_modules = ['nw_test_loop_without_handle',
'bignum',
+ 'dtrace-provider',
+ 'ref',
+ 'lame',
];
script_dir = os.path.dirname(__file__)
Something went wrong with that request. Please try again.