Skip to content

Merge pull request #297 from htdangkhoa/develop

Sign in for the full log view
GitHub Actions / Test report with Node 18 succeeded May 2, 2024 in 0s

92 passed, 0 failed and 0 skipped

Tests passed successfully

✅ junit.xml

92 tests were completed in 7s with 92 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
ALL /error 6✅ 194ms
ALL /not-found 1✅ 87ms
ALL /ping 1✅ 96ms
ALL /protocol 2✅ 71ms
ALL /render with error when views dir is not a string. 6✅ 3s
cache 7✅ 3s
cookie 13✅ 3s
GET / 16✅ 6s
Get the mimetype from file's path. 1✅ 49ms
jsonp 5✅ 110ms
params 5✅ 78ms
request 9✅ 150ms
router 8✅ 119ms
send 9✅ 3s
settings 2✅ 86ms
The middleware is not a function. 1✅ 42ms

✅ ALL /error

ALL /error The status should be 500.
  ✅ ALL /error The status should be 500.
  ✅ ALL /error The status should be 500.
ALL /not-found The status should be 404.
  ✅ ALL /not-found The status should be 404.
  ✅ ALL /not-found The status should be 404.
ALL /not-found The status should be 404 and the response text should be 'Not found.'.
  ✅ ALL /not-found The status should be 404 and the response text should be 'Not found.'.
ALL /error The status should be 500 and the response text should be 'Error.'.
  ✅ ALL /error The status should be 500 and the response text should be 'Error.'.

✅ ALL /not-found

ALL /not-found The status should be 404.
  ✅ ALL /not-found The status should be 404.

✅ ALL /ping

ALL /ping The status should be 200.
  ✅ ALL /ping The status should be 200.

✅ ALL /protocol

ALL /protocol should respect X-Forwarded-Proto.
  ✅ ALL /protocol should respect X-Forwarded-Proto.
ALL /protocol should default to the socket addr if X-Forwarded-Proto not present.
  ✅ ALL /protocol should default to the socket addr if X-Forwarded-Proto not present.

✅ ALL /render with error when views dir is not a string.

ALL /render with error when views `dir` is not a string. The status should be 500.
  ✅ ALL /render with error when views `dir` is not a string. The status should be 500.
ALL /render with error when views `ext` is not a string. The status should be 500.
  ✅ ALL /render with error when views `ext` is not a string. The status should be 500.
ALL /render with error when views `engine` is not a function. The status should be 500.
  ✅ ALL /render with error when views `engine` is not a function. The status should be 500.
ALL /render-ejs-error The status should be 503.
  ✅ ALL /render-ejs-error The status should be 503.
ALL /render The 'content-type' in header should be 'text/html; charset=utf-8'.
  ✅ ALL /render The 'content-type' in header should be 'text/html; charset=utf-8'.
ALL /render-with-options The 'content-type' in header should be 'text/html; charset=utf-8'.
  ✅ ALL /render-with-options The 'content-type' in header should be 'text/html; charset=utf-8'.

✅ cache

cache GET /get-cache The status should be 200.
  ✅ cache GET /get-cache The status should be 200.
cache POST /override-key The status should be 200.
  ✅ cache POST /override-key The status should be 200.
cache POST /set-cache The status should be 200.
  ✅ cache POST /set-cache The status should be 200.
cache DELETE /delete-cache The status should be 200.
  ✅ cache DELETE /delete-cache The status should be 200.
cache GET /jsonp-with-escape The status should be 200.
  ✅ cache GET /jsonp-with-escape The status should be 200.
cache GET /error The status should be 500.
  ✅ cache GET /error The status should be 500.
cache GET /get-cache with expires time The status should be 200.
  ✅ cache GET /get-cache with expires time The status should be 200.

✅ cookie

cookie res.cookie The 'foo' should be equal 'bar'.
  ✅ cookie res.cookie The 'foo' should be equal 'bar'.
cookie res.cookie The 'foo' should be equal 'bar' with sameSite=true.
  ✅ cookie res.cookie The 'foo' should be equal 'bar' with sameSite=true.
cookie res.cookie The 'foo' should be equal 'bar' with sameSite=strict.
  ✅ cookie res.cookie The 'foo' should be equal 'bar' with sameSite=strict.
cookie res.cookie The 'foo' should be equal 'bar' with sameSite=lax.
  ✅ cookie res.cookie The 'foo' should be equal 'bar' with sameSite=lax.
cookie res.cookie The 'foo' should be equal 'bar' with sameSite=none.
  ✅ cookie res.cookie The 'foo' should be equal 'bar' with sameSite=none.
cookie res.cookie The 'foo' should be equal 'bar' with signed=true.
  ✅ cookie res.cookie The 'foo' should be equal 'bar' with signed=true.
cookie res.cookie The 'foo' should be equal '{ "ping": "pong" }'.
  ✅ cookie res.cookie The 'foo' should be equal '{ "ping": "pong" }'.
cookie res.cookie The status should be 500 with wrong maxAge type.
  ✅ cookie res.cookie The status should be 500 with wrong maxAge type.
cookie res.cookie The status should be 500 with wrong sameSite type.
  ✅ cookie res.cookie The status should be 500 with wrong sameSite type.
cookie res.cookie The status should be 500 with option signed=true without secret.
  ✅ cookie res.cookie The status should be 500 with option signed=true without secret.
cookie res.clearCookie The 'foo' should be empty.
  ✅ cookie res.clearCookie The 'foo' should be empty.
cookie req.cookies The cookie must be set in request.
  ✅ cookie req.cookies The cookie must be set in request.
cookie req.signedCookies The status should be 200 and the body should be equal { "foo": "bar" }.
  ✅ cookie req.signedCookies The status should be 200 and the body should be equal { "foo": "bar" }.

✅ GET /

GET / A string should be returned.
  ✅ GET / A string should be returned.
POST / A string should be returned.
  ✅ POST / A string should be returned.
ALL /status An object should be returned.
  ✅ ALL /status An object should be returned.
ALL /get-header The status should be 503.
  ✅ ALL /get-header The status should be 503.
ALL /timeout The status should be 503.
  ✅ ALL /timeout The status should be 503.
GET /api/hello/{name} A string should be returned.
  ✅ GET /api/hello/{name} A string should be returned.
GET /api/query?s={...} A string should be returned.
  ✅ GET /api/query?s={...} A string should be returned.
POST /api/search/{s}? An object should be returned.
  ✅ POST /api/search/{s}? An object should be returned.
POST /api/post-body An object should be returned.
  ✅ POST /api/post-body An object should be returned.
POST /api/sub-router/test The result should be a string like /api/sub-router/test.
  ✅ POST /api/sub-router/test The result should be a string like /api/sub-router/test.
GET /not-found Http status code should be 404.
  ✅ GET /not-found Http status code should be 404.
ALL /set-header The 'X-Test' header should be 'Hello World!'.
  ✅ ALL /set-header The 'X-Test' header should be 'Hello World!'.
ALL /set-status The status should be 400.
  ✅ ALL /set-status The status should be 400.
ALL /redirect The location should be /.
  ✅ ALL /redirect The location should be /.
ALL /redirect-with-status The location should be / and the status should be 200.
  ✅ ALL /redirect-with-status The location should be / and the status should be 200.
  ✅ ALL /redirect-with-status The location should be / and the status should be 200.

✅ Get the mimetype from file's path.

Get the mimetype from file's path. Should be return 'text/html'.
  ✅ Get the mimetype from file's path. Should be return 'text/html'.

✅ jsonp

jsonp should respond with jsonp
  ✅ jsonp should respond with jsonp
  ✅ jsonp should respond with jsonp
  ✅ jsonp should respond with jsonp
  ✅ jsonp should respond with jsonp
  ✅ jsonp should respond with jsonp

✅ params

params The uid from response should be '1'.
  ✅ params The uid from response should be '1'.
  ✅ params The uid from response should be '1'.
params The status should be 200.
  ✅ params The status should be 200.
  ✅ params The status should be 200.
  ✅ params The status should be 200.

✅ request

request .secure when X-Forwarded-Proto is missing.
  ✅ request .secure when X-Forwarded-Proto is missing.
request .secure when X-Forwarded-Proto is present.
  ✅ request .secure when X-Forwarded-Proto is present.
request .secure should default to the socket addr if X-Forwarded-Proto not present.
  ✅ request .secure should default to the socket addr if X-Forwarded-Proto not present.
request .hostname should return the string.
  ✅ request .hostname should return the string.
request .host should return the string.
  ✅ request .host should return the string.
request .port should return the number.
  ✅ request .port should return the number.
request .port should return 80.
  ✅ request .port should return 80.
request .port should return 443.
  ✅ request .port should return 443.
request .path should return the string.
  ✅ request .path should return the string.

✅ router

router should be matched
  ✅ router should be matched
  ✅ router should be matched
  ✅ router should be matched
  ✅ router should be matched
  ✅ router should be matched
  ✅ router should be matched
  ✅ router should be matched
  ✅ router should be matched

✅ send

send The response text should be empty when request's method is 'HEAD'.
  ✅ send The response text should be empty when request's method is 'HEAD'.
send The response text should be 'OK'.
  ✅ send The response text should be 'OK'.
send The response text should be '999'.
  ✅ send The response text should be '999'.
send The response text should be empty when data is 'null'.
  ✅ send The response text should be empty when data is 'null'.
send The response text should be empty when data is 'undefined'.
  ✅ send The response text should be empty when data is 'undefined'.
send The response should be a Buffer.
  ✅ send The response should be a Buffer.
  ✅ send The response should be a Buffer.
send The 'content-type' in header should be 'text/css; charset=utf-8' without options.
  ✅ send The 'content-type' in header should be 'text/css; charset=utf-8' without options.
send The 'content-type' in header should be 'text/css; charset=utf-8' with options.
  ✅ send The 'content-type' in header should be 'text/css; charset=utf-8' with options.

✅ settings

settings should set and get configs
  ✅ settings should set and get configs
settings should return undefined if the config is not set
  ✅ settings should return undefined if the config is not set

✅ The middleware is not a function.

The middleware is not a function. Should be throw the error.
  ✅ The middleware is not a function. Should be throw the error.