add tests

This commit is contained in:
Alvaro Muñoz
2022-12-14 13:11:02 +01:00
parent 270a4355df
commit a71fc930a6
4 changed files with 20 additions and 4 deletions

View File

@@ -15,3 +15,14 @@ module.exports = routes`
GET /redirect/:redirect_url redirect
POST /packages/new createPackage
`(require('../views'))
const a = routes`GET /packages/package/${p} viewPackage`(require('../views')) // test:routeSetup
const b = routes`GET / list`({ ...require('../views'), ...require('../views/orgs') }) // test: routeSetup
const c = routes`POST /message handleMessage`({ handleMessage: console.log }) // test: routeSetup
const d = routes`GET /version versionHandler`({ versionHandler: (req, context) => { console.log(req) } }) // test: routeSetup
const e = routes`GET / handler`({ handler: async (req, context) => { console.log(req) } }) // test: routeSetup

View File

@@ -26,6 +26,11 @@ passingPositiveTests
| PASSED | headerDefinition | lib/views/index.js:107:88:107:150 | // test ... inition |
| PASSED | redirectSink | lib/views/index.js:54:54:54:82 | // test ... source |
| PASSED | responseBody | lib/views/index.js:38:61:38:136 | // test ... nseBody |
| PASSED | routeSetup | lib/routes/index.js:20:79:20:96 | // test:routeSetup |
| PASSED | routeSetup | lib/routes/index.js:22:87:22:105 | // test: routeSetup |
| PASSED | routeSetup | lib/routes/index.js:24:81:24:99 | // test: routeSetup |
| PASSED | routeSetup | lib/routes/index.js:26:107:26:125 | // test: routeSetup |
| PASSED | routeSetup | lib/routes/index.js:28:92:28:110 | // test: routeSetup |
| PASSED | source | lib/views/index.js:24:56:24:70 | // test: source |
| PASSED | source | lib/views/index.js:29:28:29:42 | // test: source |
| PASSED | source | lib/views/index.js:30:28:30:42 | // test: source |

View File

@@ -51,7 +51,7 @@ query predicate passingPositiveTests(string res, string expectation, InlineTest
expectation = "source" and
exists(RemoteFlowSource n | t.inNode(n))
or
expectation = "setup" and
expectation = "routeSetup" and
exists(Http::RouteSetup n | t.inNode(n))
or
expectation = "handler" and
@@ -107,7 +107,7 @@ query predicate failingPositiveTests(string res, string expectation, InlineTest
expectation = "source" and
not exists(RemoteFlowSource n | t.inNode(n))
or
expectation = "setup" and
expectation = "routeSetup" and
not exists(Http::RouteSetup n | t.inNode(n))
or
expectation = "handler" and
@@ -163,7 +163,7 @@ query predicate passingNegativeTests(string res, string expectation, InlineTest
expectation = "!source" and
not exists(RemoteFlowSource n | t.inNode(n))
or
expectation = "!setup" and
expectation = "!routeSetup" and
not exists(Http::RouteSetup n | t.inNode(n))
or
expectation = "!handler" and
@@ -219,7 +219,7 @@ query predicate failingNegativeTests(string res, string expectation, InlineTest
expectation = "!source" and
exists(RemoteFlowSource n | t.inNode(n))
or
expectation = "!setup" and
expectation = "!routeSetup" and
exists(Http::RouteSetup n | t.inNode(n))
or
expectation = "!handler" and