Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
getTestFile
1 parent 5ce6b84 commit bdd07deCopy full SHA for bdd07de
1 file changed
javascript/ql/lib/semmle/javascript/frameworks/Testing.qll
@@ -39,12 +39,14 @@ class BDDTest extends Test, @call_expr {
39
}
40
41
/**
42
- * Gets the test file for `f` with stem extension `stemExt`.
+ * Gets the test file for `f` with stem extension `stemExt`, where `stemExt` is "test" or "spec".
43
* That is, a file named file named `<base>.<stemExt>.<ext>` in the
44
* same directory as `f` which is named `<base>.<ext>`.
45
*/
46
-bindingset[stemExt]
+pragma[noinline]
47
File getTestFile(File f, string stemExt) {
48
+ stemExt = ["test", "spec"] and
49
+ result.getBaseName().regexpMatch(".*\\.(test|spec)\\..*") and
50
result = f.getParentContainer().getFile(f.getStem() + "." + stemExt + "." + f.getExtension())
51
52
0 commit comments