Skip to content

Commit a71fc93

Browse files
author
Alvaro Muñoz
committed
add tests
1 parent 270a435 commit a71fc93

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

javascript/ql/test/library-tests/frameworks/Spife/lib/routes/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,14 @@ module.exports = routes`
1515
GET /redirect/:redirect_url redirect
1616
POST /packages/new createPackage
1717
`(require('../views'))
18+
19+
20+
const a = routes`GET /packages/package/${p} viewPackage`(require('../views')) // test:routeSetup
21+
22+
const b = routes`GET / list`({ ...require('../views'), ...require('../views/orgs') }) // test: routeSetup
23+
24+
const c = routes`POST /message handleMessage`({ handleMessage: console.log }) // test: routeSetup
25+
26+
const d = routes`GET /version versionHandler`({ versionHandler: (req, context) => { console.log(req) } }) // test: routeSetup
27+
28+
const e = routes`GET / handler`({ handler: async (req, context) => { console.log(req) } }) // test: routeSetup

javascript/ql/test/library-tests/frameworks/Spife/lib/views/orgs.js

Whitespace-only changes.

javascript/ql/test/library-tests/frameworks/Spife/tests.expected

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ passingPositiveTests
2626
| PASSED | headerDefinition | lib/views/index.js:107:88:107:150 | // test ... inition |
2727
| PASSED | redirectSink | lib/views/index.js:54:54:54:82 | // test ... source |
2828
| PASSED | responseBody | lib/views/index.js:38:61:38:136 | // test ... nseBody |
29+
| PASSED | routeSetup | lib/routes/index.js:20:79:20:96 | // test:routeSetup |
30+
| PASSED | routeSetup | lib/routes/index.js:22:87:22:105 | // test: routeSetup |
31+
| PASSED | routeSetup | lib/routes/index.js:24:81:24:99 | // test: routeSetup |
32+
| PASSED | routeSetup | lib/routes/index.js:26:107:26:125 | // test: routeSetup |
33+
| PASSED | routeSetup | lib/routes/index.js:28:92:28:110 | // test: routeSetup |
2934
| PASSED | source | lib/views/index.js:24:56:24:70 | // test: source |
3035
| PASSED | source | lib/views/index.js:29:28:29:42 | // test: source |
3136
| PASSED | source | lib/views/index.js:30:28:30:42 | // test: source |

javascript/ql/test/library-tests/frameworks/Spife/tests.ql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ query predicate passingPositiveTests(string res, string expectation, InlineTest
5151
expectation = "source" and
5252
exists(RemoteFlowSource n | t.inNode(n))
5353
or
54-
expectation = "setup" and
54+
expectation = "routeSetup" and
5555
exists(Http::RouteSetup n | t.inNode(n))
5656
or
5757
expectation = "handler" and
@@ -107,7 +107,7 @@ query predicate failingPositiveTests(string res, string expectation, InlineTest
107107
expectation = "source" and
108108
not exists(RemoteFlowSource n | t.inNode(n))
109109
or
110-
expectation = "setup" and
110+
expectation = "routeSetup" and
111111
not exists(Http::RouteSetup n | t.inNode(n))
112112
or
113113
expectation = "handler" and
@@ -163,7 +163,7 @@ query predicate passingNegativeTests(string res, string expectation, InlineTest
163163
expectation = "!source" and
164164
not exists(RemoteFlowSource n | t.inNode(n))
165165
or
166-
expectation = "!setup" and
166+
expectation = "!routeSetup" and
167167
not exists(Http::RouteSetup n | t.inNode(n))
168168
or
169169
expectation = "!handler" and
@@ -219,7 +219,7 @@ query predicate failingNegativeTests(string res, string expectation, InlineTest
219219
expectation = "!source" and
220220
exists(RemoteFlowSource n | t.inNode(n))
221221
or
222-
expectation = "!setup" and
222+
expectation = "!routeSetup" and
223223
exists(Http::RouteSetup n | t.inNode(n))
224224
or
225225
expectation = "!handler" and

0 commit comments

Comments
 (0)