feat: add mock call history to access request configuration in test #15881
Annotations
10 errors and 1 notice
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] (D:\a\undici\undici\node_modules\@matteo.collina\tspl\tspl.js:52:35)
at TestContext.<anonymous> (D:\a\undici\undici\test\mock-pool.js:61:7)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:796:25)
at Test.start (node:internal/test_runner/test:703:17)
at node:internal/test_runner/test:1133:71
at node:internal/per_context/primordials:482:82
at new Promise (<anonymous>)
at new SafePromise (node:internal/per_context/primordials:450:29)
at node:internal/per_context/primordials:482:9 {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: TypeError: Cannot read properties of undefined (reading '_add')
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:264:34)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:339:22)
at D:\a\undici\undici\test\mock-pool.js:61:35
at getActual (node:assert:498:5)
at Function.doesNotThrow (node:assert:664:32)
at res.<computed> [as doesNotThrow] (D:\a\undici\undici\node_modules\@matteo.collina\tspl\tspl.js:52:35)
at TestContext.<anonymous> (D:\a\undici\undici\test\mock-pool.js:61:7)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:796:25)
at Test.start (node:internal/test_runner/test:703: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] (D:\a\undici\undici\node_modules\@matteo.collina\tspl\tspl.js:52:35)
at TestContext.<anonymous> (D:\a\undici\undici\test\mock-pool.js:96:7)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:796:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:527:18)
at Test.postRun (node:internal/test_runner/test:889:19)
at Test.run (node:internal/test_runner/test:835:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:1135:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:527:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: TypeError: Cannot read properties of undefined (reading '_add')
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:264:34)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:339:22)
at D:\a\undici\undici\test\mock-pool.js:96:29
at getActual (node:assert:498:5)
at Function.throws (node:assert:644:24)
at res.<computed> [as throws] (D:\a\undici\undici\node_modules\@matteo.collina\tspl\tspl.js:52:35)
at TestContext.<anonymous> (D:\a\undici\undici\test\mock-pool.js:96:7)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:796:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:527:18),
expected: Error: kaboom
at TestContext.<anonymous> (D:\a\undici\undici\test\mock-pool.js:103:9)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:796:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:527:18)
at Test.postRun (node:internal/test_runner/test:889:19)
at Test.run (node:internal/test_runner/test:835:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:1135:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:527: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 (D:\a\undici\undici\lib\mock\mock-utils.js:264:34)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:339:22)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:188:10)
at D:\a\undici\undici\lib\api\api-request.js:179:15
at new Promise (<anonymous>)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:178:12)
at D:\a\undici\undici\index.js:102:15
at TestContext.<anonymous> (D:\a\undici\undici\test\mock-pool.js:211:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Test.run (node:internal/test_runner/test:797: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 (D:\a\undici\undici\lib\mock\mock-utils.js:264:34)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:339:22)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:188:10)
at D:\a\undici\undici\lib\api\api-request.js:179:15
at new Promise (<anonymous>)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:178:12)
at D:\a\undici\undici\index.js:102:15
at TestContext.<anonymous> (D:\a\undici\undici\test\mock-pool.js:246:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Test.run (node:internal/test_runner/test:797: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 (D:\a\undici\undici\lib\mock\mock-utils.js:264:34)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:339:22)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:188:10)
at D:\a\undici\undici\lib\api\api-request.js:179:15
at new Promise (<anonymous>)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:178:12)
at TestContext.<anonymous> (D:\a\undici\undici\test\mock-pool.js:285:66)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Test.run (node:internal/test_runner/test:797:9)
at async Test.processPendingSubtests (node:internal/test_runner/test:527: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 (D:\a\undici\undici\lib\mock\mock-utils.js:264:34)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:339:22)
at [dispatch] (D:\a\undici\undici\lib\dispatcher\agent.js:91:23)
at Agent.dispatch (D:\a\undici\undici\lib\dispatcher\dispatcher-base.js:148:29)
at MockAgent.dispatch (D:\a\undici\undici\lib\mock\mock-agent.js:61:25)
at MockAgent.request (D:\a\undici\undici\lib\api\api-request.js:188:10)
at D:\a\undici\undici\lib\api\api-request.js:179:15
at new Promise (<anonymous>)
at MockAgent.request (D:\a\undici\undici\lib\api\api-request.js:178:12)
at D:\a\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 (D:\a\undici\undici\index.js:120:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async TestContext.<anonymous> (D:\a\undici\undici\test\mock-pool.js:348:3)
at async Test.run (node:internal/test_runner/test:797:9)
at async Test.processPendingSubtests (node:internal/test_runner/test:527:7) {
[cause]: TypeError [Error]: Cannot read properties of undefined (reading '_add')
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:264:34)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:339:22)
at [dispatch] (D:\a\undici\undici\lib\dispatcher\agent.js:91:23)
at Agent.dispatch (D:\a\undici\undici\lib\dispatcher\dispatcher-base.js:148:29)
at MockAgent.dispatch (D:\a\undici\undici\lib\mock\mock-agent.js:61:25)
at D:\a\undici\undici\lib\web\fetch\index.js:2060:51
at new Promise (<anonymous>)
at dispatch (D:\a\undici\undici\lib\web\fetch\index.js:2060:12)
at httpNetworkFetch (D:\a\undici\undici\lib\web\fetch\index.js:1859:69)
at httpNetworkOrCacheFetch (D:\a\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 (D:\a\undici\undici\lib\mock\mock-utils.js:264:34)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:339:22)
at TestContext.<anonymous> (D:\a\undici\undici\test\mock-interceptor.js:99:14)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:796:25)
at Test.start (node:internal/test_runner/test:703:17)
at node:internal/test_runner/test:1133:71
at node:internal/per_context/primordials:482:82
at new Promise (<anonymous>)
at new SafePromise (node:internal/per_context/primordials:450: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] (D:\a\undici\undici\node_modules\@matteo.collina\tspl\tspl.js:52:35)
at TestContext.<anonymous> (D:\a\undici\undici\test\mock-interceptor.js:146:7)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:796:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:527:18)
at Test.postRun (node:internal/test_runner/test:889:19)
at Test.run (node:internal/test_runner/test:835:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:1135:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:527:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: TypeError: Cannot read properties of undefined (reading '_add')
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:264:34)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:339:22)
at D:\a\undici\undici\test\mock-interceptor.js:146:29
at getActual (node:assert:498:5)
at Function.throws (node:assert:644:24)
at res.<computed> [as throws] (D:\a\undici\undici\node_modules\@matteo.collina\tspl\tspl.js:52:35)
at TestContext.<anonymous> (D:\a\undici\undici\test\mock-interceptor.js:146:7)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:796:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:527:18),
expected: InvalidArgumentError: reply options callback must return an object
at TestContext.<anonymous> (D:\a\undici\undici\test\mock-interceptor.js:153:9)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:796:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:527:18)
at Test.postRun (node:internal/test_runner/test:889:19)
at Test.run (node:internal/test_runner/test:835:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:1135:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:527:7),
operator: 'throws'
}
}
|
Run tests
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.
Total Tests: 1022
Suites 📂: 92
Passed ✅: 882
Failed ❌: 132
Canceled 🚫: 3
Skipped ⏭️: 5
Todo 📝: 0
Duration 🕐: 61996.893ms
|
Loading