0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00
nodejs/test/test-module-loading.js
Ryan 8b49cef10b Modify the tests to use onExit hook.
No need to rely on stdout output now.
onExit callbacks should print stack trace from onExit failure
2009-06-08 19:10:36 +02:00

41 lines
897 B
JavaScript

include("mjsunit.js");
var a = require("fixtures/a.js");
var d = require("fixtures/b/d.js");
var d2 = require("fixtures/b/d.js");
function onLoad () {
assertFalse(false, "testing the test program.");
assertInstanceof(a.A, Function);
assertEquals("A", a.A());
assertInstanceof(a.C, Function);
assertEquals("C", a.C());
assertInstanceof(a.D, Function);
assertEquals("D", a.D());
assertInstanceof(d.D, Function);
assertEquals("D", d.D());
assertInstanceof(d2.D, Function);
assertEquals("D", d2.D());
}
function onExit () {
assertInstanceof(a.A, Function);
assertEquals("A done", a.A());
assertInstanceof(a.C, Function);
assertEquals("C done", a.C());
assertInstanceof(a.D, Function);
assertEquals("D done", a.D());
assertInstanceof(d.D, Function);
assertEquals("D done", d.D());
assertInstanceof(d2.D, Function);
assertEquals("D done", d2.D());
}