Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 252902d

Browse files
author
Max Schaefer
committed
JavaScript: Restructure API-graph tests.
With the old test runner we cannot have `VerifyAssertions.qlref`s for each individual test that reference a shared `VerifyAssertions.ql` in the parent directory, since it doesn't like nested tests. Instead, we have to turn `VerifyAssertions.ql` into `VerifyAssertions.qll`, and each `VerifyAsssertions.qlref` into a `VerifyAssertions.ql` that imports it. But then that doesn't work with our old directory structure, since the import path would have to contain the invalid identifier `library-tests`. As a workaround, I have moved the API graph tests into a directory without dashes in its path.
1 parent cb433a0 commit 252902d

91 files changed

Lines changed: 26 additions & 31 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

javascript/ql/test/library-tests/ApiGraphs/VerifyAssertions.ql renamed to javascript/ql/test/ApiGraphs/VerifyAssertions.qll

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@
2020

2121
import javascript
2222

23-
class CustomEntryPoint extends API::EntryPoint {
24-
CustomEntryPoint() { this = "CustomEntryPoint" }
25-
26-
override DataFlow::SourceNode getAUse() { result = DataFlow::globalVarRef("CustomEntryPoint") }
27-
28-
override DataFlow::Node getARhs() { none() }
29-
}
30-
3123
private DataFlow::Node getNode(API::Feature nd, string kind) {
3224
kind = "def" and
3325
result = nd.getARhs()
@@ -122,5 +114,4 @@ class Assertion extends Comment {
122114
}
123115
}
124116

125-
from Assertion a
126-
select a, a.explainFailure()
117+
query predicate failed(Assertion a, string explanation) { explanation = a.explainFailure() }

javascript/ql/test/library-tests/ApiGraphs/argprops/VerifyAssertions.expected renamed to javascript/ql/test/ApiGraphs/argprops/VerifyAssertions.expected

File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import ApiGraphs.VerifyAssertions
File renamed without changes.

javascript/ql/test/library-tests/ApiGraphs/argprops/package.json renamed to javascript/ql/test/ApiGraphs/argprops/package.json

File renamed without changes.

javascript/ql/test/library-tests/ApiGraphs/async-await/VerifyAssertions.expected renamed to javascript/ql/test/ApiGraphs/async-await/VerifyAssertions.expected

File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import ApiGraphs.VerifyAssertions

javascript/ql/test/library-tests/ApiGraphs/async-await/index.js renamed to javascript/ql/test/ApiGraphs/async-await/index.js

File renamed without changes.

javascript/ql/test/library-tests/ApiGraphs/async-await/package.json renamed to javascript/ql/test/ApiGraphs/async-await/package.json

File renamed without changes.

javascript/ql/test/library-tests/ApiGraphs/branching-flow/VerifyAssertions.expected renamed to javascript/ql/test/ApiGraphs/branching-flow/VerifyAssertions.expected

File renamed without changes.

0 commit comments

Comments
 (0)