Allow foo, fooTest, fooTest.js, and tests/fooTest.js when running tests
This commit is contained in:
parent
4d37b3d4c9
commit
d67e615b73
1 changed files with 8 additions and 4 deletions
|
@ -100,11 +100,15 @@ if(ZoteroUnit.tests) {
|
|||
}
|
||||
} else {
|
||||
var specifiedTests = ZoteroUnit.tests.split(",");
|
||||
for(var test of specifiedTests) {
|
||||
var fname = test+".js",
|
||||
file = testDirectory.clone();
|
||||
for (let test of specifiedTests) {
|
||||
// Allow foo, fooTest, fooTest.js, and tests/fooTest.js
|
||||
test = test.replace(/\.js$/, "");
|
||||
test = test.replace(/Test$/, "");
|
||||
test = test.replace(/^tests[/\\]/, "");
|
||||
let fname = test + "Test.js";
|
||||
let file = testDirectory.clone();
|
||||
file.append(fname);
|
||||
if(!file.exists()) {
|
||||
if (!file.exists()) {
|
||||
dump("Invalid test file "+test+"\n");
|
||||
run = false;
|
||||
quit(true);
|
||||
|
|
Loading…
Add table
Reference in a new issue