Tests in multiple config groups only one once in node.js?

11 views
Skip to first unread message

Garrick Cheung

unread,
Oct 4, 2013, 5:20:01 AM10/4/13
to bust...@googlegroups.com
Hey guys,

I don't know if this is expected or an issue. I'm only able to tests once when its clearly defined in multiple groups in the config file.

Something like:

var config = module.exports;

config["Group 1"] = {
rootPath: "../",
environment: "node",
tests: [
"test/test1.js",
"test/test2.js"
]
};

config["Group 2"] = {
extends: "Group 1",
tests: [
"test/test1.js",
"test/test2.js"
]
};

I've identified why it's only running once. buster-test-cli/lib/runners/node.js has a descriptiveRequire function that require files. As expected, require'ing a file loads it into node.js' cache so every call to the same module would return the same module without executing the code in that module more than once.

Is this testing to be expected? It looks like it should actually be run for every time it's defined in a group. An example of why this should be the case is when I have an extension that has different options for each group.

Garrick Cheung

unread,
Oct 4, 2013, 5:54:57 AM10/4/13
to bust...@googlegroups.com
Oops, correction.

Tests clearly defined in multiple groups in the config file are only run once.

Christian Johansen

unread,
Oct 7, 2013, 2:11:32 AM10/7/13
to bust...@googlegroups.com
Hah,

This is indeed a bug. I guess the node runner should explicitly flush
the npm cache as its first step. Care to file an issue (or better yet, PR)?

Christian

Garrick Cheung

unread,
Oct 7, 2013, 4:11:25 AM10/7/13
to bust...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages