Skip to content

Commit f74fe74

Browse files
committed
better node tests wrapping
1 parent 74abb4e commit f74fe74

1 file changed

Lines changed: 25 additions & 17 deletions

File tree

‎test/browsertest/nodetests/index.js‎

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
11
require("./common").globalCheck = false;
22

3-
try { require("./simple/test-assert.js"); } catch(e) { window.test(false, "Node.js Test should not fail with " + e ); }
4-
try { require("./simple/test-event-emitter-check-listener-leaks.js"); } catch(e) { window.test(false, "Node.js Test should not fail with " + e ); }
5-
try { require("./simple/test-event-emitter-modify-in-emit.js"); } catch(e) { window.test(false, "Node.js Test should not fail with " + e ); }
6-
try { require("./simple/test-event-emitter-num-args.js"); } catch(e) { window.test(false, "Node.js Test should not fail with " + e ); }
7-
try { require("./simple/test-event-emitter-remove-all-listeners.js"); } catch(e) { window.test(false, "Node.js Test should not fail with " + e ); }
8-
try { require("./simple/test-global.js"); } catch(e) { window.test(false, "Node.js Test should not fail with " + e ); }
9-
try { require("./simple/test-next-tick-doesnt-hang.js"); } catch(e) { window.test(false, "Node.js Test should not fail with " + e ); }
10-
try { require("./simple/test-next-tick-ordering2.js"); } catch(e) { window.test(false, "Node.js Test should not fail with " + e ); }
11-
try { require("./simple/test-path.js"); } catch(e) { window.test(false, "Node.js Test should not fail with " + e ); }
12-
try { require("./simple/test-querystring.js"); } catch(e) { window.test(false, "Node.js Test should not fail with " + e ); }
13-
try { require("./simple/test-sys.js"); } catch(e) { window.test(false, "Node.js Test should not fail with " + e ); }
14-
try { require("./simple/test-timers-zero-timeout.js"); } catch(e) { window.test(false, "Node.js Test should not fail with " + e ); }
15-
try { require("./simple/test-timers.js"); } catch(e) { window.test(false, "Node.js Test should not fail with " + e ); }
16-
try { require("./simple/test-url.js"); } catch(e) { window.test(false, "Node.js Test should not fail with " + e ); }
17-
try { require("./simple/test-util-format.js"); } catch(e) { window.test(false, "Node.js Test should not fail with " + e ); }
18-
try { require("./simple/test-util-inspect.js"); } catch(e) { window.test(false, "Node.js Test should not fail with " + e ); }
19-
try { require("./simple/test-util.js"); } catch(e) { window.test(false, "Node.js Test should not fail with " + e ); }
3+
function simple(name) {
4+
try {
5+
require("./simple/test-"+name);
6+
} catch(e) {
7+
window.test(false, "Node.js Test '"+name+"' should not fail with " + e );
8+
}
9+
}
10+
11+
simple("assert");
12+
simple("event-emitter-check-listener-leaks");
13+
simple("event-emitter-modify-in-emit");
14+
simple("event-emitter-num-args");
15+
simple("event-emitter-remove-all-listeners");
16+
simple("global");
17+
simple("next-tick-doesnt-hang");
18+
simple("next-tick-ordering2");
19+
simple("path");
20+
simple("querystring");
21+
simple("sys");
22+
simple("timers-zero-timeout");
23+
simple("timers");
24+
simple("url");
25+
simple("util-format");
26+
simple("util-inspect");
27+
simple("util");
2028

2129
window.test(true, "Node.js simple tests should complete");
2230

0 commit comments

Comments
 (0)