Skip to content

Commit d4d9d61

Browse files
author
Max Schaefer
committed
JavaScript: Consolidate Express tests.
Instead of having many small independent tests, we now just have a single test that pulls in all the individual tests and runs them together. Concretely, each `.ql` file has been turned into a `.qll` file with a query predicate corresponding to the original `select` clause and named after the original `.ql` file, plus a prefix `test_`. The newly added `tests.ql` imports all these `.qll`s. The individual `.expected` files have been concatenated together into `tests.expected`, each prefixed with the name of the corresponding query predicate. (This is the format that qltest produces for tests with multiple query predicates.)
1 parent b265ff7 commit d4d9d61

File tree

145 files changed

+1250
-1105
lines changed

Some content is hidden

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

145 files changed

+1250
-1105
lines changed

javascript/ql/test/library-tests/frameworks/Express/CookieMiddlewareInstance.expected

Lines changed: 0 additions & 9 deletions
This file was deleted.

javascript/ql/test/library-tests/frameworks/Express/CookieMiddlewareInstance.ql

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import javascript
2+
3+
query
4+
predicate test_CookieMiddlewareInstance(HTTP::CookieMiddlewareInstance instance, DataFlow::Node res) {
5+
res = instance.getASecretKey()
6+
}

javascript/ql/test/library-tests/frameworks/Express/Credentials.expected

Lines changed: 0 additions & 2 deletions
This file was deleted.

javascript/ql/test/library-tests/frameworks/Express/Credentials.ql

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import javascript
2+
3+
query predicate test_Credentials(Express::Credentials cr, string res) {
4+
res = cr.getCredentialsKind()
5+
}

javascript/ql/test/library-tests/frameworks/Express/ExpressSession.expected

Lines changed: 0 additions & 2 deletions
This file was deleted.

javascript/ql/test/library-tests/frameworks/Express/ExpressSession.ql

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import javascript
2+
import semmle.javascript.frameworks.ExpressModules
3+
4+
query
5+
predicate test_ExpressSession(ExpressLibraries::ExpressSession::MiddlewareInstance session,
6+
string name, DataFlow::Node res) {
7+
res = session.getOption(name)
8+
}

javascript/ql/test/library-tests/frameworks/Express/HeaderAccess.expected

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)