feat: add mock call history to access request configuration in test #15881
Annotations
10 errors and 2 notices
Run tests:
test/mock-pool.js#L61
Error [ERR_TEST_FAILURE]: Got unwanted exception.
Actual message: "Cannot read properties of undefined (reading '_add')"
at new Promise (<anonymous>)
at Array.map (<anonymous>) {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: AssertionError [ERR_ASSERTION]: Got unwanted exception.
Actual message: "Cannot read properties of undefined (reading '_add')"
at res.<computed> [as doesNotThrow] (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-pool.js:61:7)
at Test.runInAsyncScope (node:async_hooks:211:14)
at Test.run (node:internal/test_runner/test:931:25)
at Test.start (node:internal/test_runner/test:829:17)
at node:internal/test_runner/test:1308:71
at node:internal/per_context/primordials:483:82
at new Promise (<anonymous>)
at new SafePromise (node:internal/per_context/primordials:451:29)
at node:internal/per_context/primordials:483:9 {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: TypeError: Cannot read properties of undefined (reading '_add')
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:264:34)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:339:22)
at /Users/runner/work/undici/undici/test/mock-pool.js:61:35
at getActual (node:assert:836:5)
at Function.doesNotThrow (node:assert:1002:32)
at res.<computed> [as doesNotThrow] (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-pool.js:61:7)
at Test.runInAsyncScope (node:async_hooks:211:14)
at Test.run (node:internal/test_runner/test:931:25)
at Test.start (node:internal/test_runner/test:829:17),
expected: undefined,
operator: 'doesNotThrow'
}
}
|
Run tests:
test/mock-pool.js#L96
Error [ERR_TEST_FAILURE]: Expected values to be strictly deep-equal:
+ actual - expected
Comparison {
+ message: "Cannot read properties of undefined (reading '_add')",
+ name: 'TypeError'
- message: 'kaboom',
- name: 'Error'
}
at async Promise.all (index 0) {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected
Comparison {
+ message: "Cannot read properties of undefined (reading '_add')",
+ name: 'TypeError'
- message: 'kaboom',
- name: 'Error'
}
at res.<computed> [as throws] (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-pool.js:96:7)
at Test.runInAsyncScope (node:async_hooks:211:14)
at Test.run (node:internal/test_runner/test:931:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:629:18)
at Test.postRun (node:internal/test_runner/test:1042:19)
at Test.run (node:internal/test_runner/test:970:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:1310:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:629:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: TypeError: Cannot read properties of undefined (reading '_add')
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:264:34)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:339:22)
at /Users/runner/work/undici/undici/test/mock-pool.js:96:29
at getActual (node:assert:836:5)
at Function.throws (node:assert:982:24)
at res.<computed> [as throws] (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-pool.js:96:7)
at Test.runInAsyncScope (node:async_hooks:211:14)
at Test.run (node:internal/test_runner/test:931:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:629:18),
expected: Error: kaboom
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-pool.js:103:9)
at Test.runInAsyncScope (node:async_hooks:211:14)
at Test.run (node:internal/test_runner/test:931:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:629:18)
at Test.postRun (node:internal/test_runner/test:1042:19)
at Test.run (node:internal/test_runner/test:970:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:1310:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:629:7),
operator: 'throws'
}
}
|
Run tests:
test/mock-pool.js#L211
[Error [ERR_TEST_FAILURE]: Cannot read properties of undefined (reading '_add')] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: TypeError [Error]: Cannot read properties of undefined (reading '_add')
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:264:34)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:339:22)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:188:10)
at /Users/runner/work/undici/undici/lib/api/api-request.js:179:15
at new Promise (<anonymous>)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:178:12)
at /Users/runner/work/undici/undici/index.js:102:15
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-pool.js:211:38)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Test.run (node:internal/test_runner/test:932:9)
}
|
Run tests:
test/mock-pool.js#L246
[Error [ERR_TEST_FAILURE]: Cannot read properties of undefined (reading '_add')] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: TypeError [Error]: Cannot read properties of undefined (reading '_add')
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:264:34)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:339:22)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:188:10)
at /Users/runner/work/undici/undici/lib/api/api-request.js:179:15
at new Promise (<anonymous>)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:178:12)
at /Users/runner/work/undici/undici/index.js:102:15
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-pool.js:246:38)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Test.run (node:internal/test_runner/test:932:9)
}
|
Run tests:
test/mock-pool.js#L285
[Error [ERR_TEST_FAILURE]: Cannot read properties of undefined (reading '_add')] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: TypeError [Error]: Cannot read properties of undefined (reading '_add')
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:264:34)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:339:22)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:188:10)
at /Users/runner/work/undici/undici/lib/api/api-request.js:179:15
at new Promise (<anonymous>)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:178:12)
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-pool.js:285:66)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Test.run (node:internal/test_runner/test:932:9)
at async Test.processPendingSubtests (node:internal/test_runner/test:629:7)
}
|
Run tests:
test/mock-pool.js#L302
[Error [ERR_TEST_FAILURE]: Cannot read properties of undefined (reading '_add')] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: TypeError [Error]: Cannot read properties of undefined (reading '_add')
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:264:34)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:339:22)
at [dispatch] (/Users/runner/work/undici/undici/lib/dispatcher/agent.js:91:23)
at Agent.dispatch (/Users/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:148:29)
at MockAgent.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-agent.js:61:25)
at MockAgent.request (/Users/runner/work/undici/undici/lib/api/api-request.js:188:10)
at /Users/runner/work/undici/undici/lib/api/api-request.js:179:15
at new Promise (<anonymous>)
at MockAgent.request (/Users/runner/work/undici/undici/lib/api/api-request.js:178:12)
at /Users/runner/work/undici/undici/index.js:102:15
}
|
Run tests:
test/mock-pool.js#L348
[Error [ERR_TEST_FAILURE]: fetch failed] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: TypeError [Error]: fetch failed
at fetch (/Users/runner/work/undici/undici/index.js:120:13)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-pool.js:348:3)
at async Test.run (node:internal/test_runner/test:932:9)
at async Test.processPendingSubtests (node:internal/test_runner/test:629:7) {
[cause]: TypeError [Error]: Cannot read properties of undefined (reading '_add')
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:264:34)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:339:22)
at [dispatch] (/Users/runner/work/undici/undici/lib/dispatcher/agent.js:91:23)
at Agent.dispatch (/Users/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:148:29)
at MockAgent.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-agent.js:61:25)
at /Users/runner/work/undici/undici/lib/web/fetch/index.js:2060:51
at new Promise (<anonymous>)
at dispatch (/Users/runner/work/undici/undici/lib/web/fetch/index.js:2060:12)
at httpNetworkFetch (/Users/runner/work/undici/undici/lib/web/fetch/index.js:1859:69)
at httpNetworkOrCacheFetch (/Users/runner/work/undici/undici/lib/web/fetch/index.js:1561:35)
}
}
|
Run tests:
test/mock-pool.js#L1
[Error [ERR_TEST_FAILURE]: test timed out after 30000ms] { code: 'ERR_TEST_FAILURE', failureType: 'testTimeoutFailure', cause: 'test timed out after 30000ms' }
|
Run tests:
test/mock-interceptor.js#L99
Error [ERR_TEST_FAILURE]: Cannot read properties of undefined (reading '_add')
at new Promise (<anonymous>)
at Array.map (<anonymous>) {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: TypeError [Error]: Cannot read properties of undefined (reading '_add')
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:264:34)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:339:22)
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-interceptor.js:99:14)
at Test.runInAsyncScope (node:async_hooks:211:14)
at Test.run (node:internal/test_runner/test:931:25)
at Test.start (node:internal/test_runner/test:829:17)
at node:internal/test_runner/test:1308:71
at node:internal/per_context/primordials:483:82
at new Promise (<anonymous>)
at new SafePromise (node:internal/per_context/primordials:451:29)
}
|
Run tests:
test/mock-interceptor.js#L146
[Error [ERR_TEST_FAILURE]: Expected values to be strictly deep-equal:
+ actual - expected
Comparison {
+ message: "Cannot read properties of undefined (reading '_add')",
+ name: 'TypeError'
- code: 'UND_ERR_INVALID_ARG',
- message: 'reply options callback must return an object',
- name: 'InvalidArgumentError'
}
] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected
Comparison {
+ message: "Cannot read properties of undefined (reading '_add')",
+ name: 'TypeError'
- code: 'UND_ERR_INVALID_ARG',
- message: 'reply options callback must return an object',
- name: 'InvalidArgumentError'
}
at res.<computed> [as throws] (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-interceptor.js:146:7)
at Test.runInAsyncScope (node:async_hooks:211:14)
at Test.run (node:internal/test_runner/test:931:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:629:18)
at Test.postRun (node:internal/test_runner/test:1042:19)
at Test.run (node:internal/test_runner/test:970:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:1310:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:629:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: TypeError: Cannot read properties of undefined (reading '_add')
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:264:34)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:339:22)
at /Users/runner/work/undici/undici/test/mock-interceptor.js:146:29
at getActual (node:assert:836:5)
at Function.throws (node:assert:982:24)
at res.<computed> [as throws] (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-interceptor.js:146:7)
at Test.runInAsyncScope (node:async_hooks:211:14)
at Test.run (node:internal/test_runner/test:931:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:629:18),
expected: InvalidArgumentError: reply options callback must return an object
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-interceptor.js:153:9)
at Test.runInAsyncScope (node:async_hooks:211:14)
at Test.run (node:internal/test_runner/test:931:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:629:18)
at Test.postRun (node:internal/test_runner/test:1042:19)
at Test.run (node:internal/test_runner/test:970:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:1310:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:629:7),
operator: 'throws'
}
}
|
Run tests:
test/issue-2349.js#L1
Error: Test "stream() does not fail after request has been aborted" at test/issue-2349.js:8:1 generated asynchronous activity after the test ended. This activity created the error "AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected
Comparison {
+ message: "Cannot read properties of undefined (reading '_add')",
+ name: 'TypeError'
- message: 'This operation was aborted',
- name: 'AbortError'
}
" and would have caused the test to fail, but instead triggered an unhandledRejection event.
|
Run tests
Total Tests: 1022
Suites 📂: 92
Passed ✅: 882
Failed ❌: 132
Canceled 🚫: 3
Skipped ⏭️: 5
Todo 📝: 0
Duration 🕐: 79886.747ms
|
Loading