feat: onConnect w/ controller #13154
nodejs.yml
on: pull_request
Matrix: test-without-intl
Matrix: test
dependency-review
0s
Lint
27s
Test TypeScript types
26s
automerge
0s
Annotations
115 errors and 11 notices
Lint:
lib/dispatcher/client-h2.js#L82
'parseH2Headers' is defined but never used
|
Lint:
lib/dispatcher/client-h2.js#L437
Trailing spaces not allowed
|
Lint:
lib/dispatcher/client-h2.js#L449
Trailing spaces not allowed
|
Lint
Process completed with exit code 1.
|
dependency-review
GitHub Actions has encountered an internal error when running your job.
|
should handle a single interceptor:
test/mock-pool.js#L61
Error [ERR_TEST_FAILURE]: Got unwanted exception.
Actual message: "Cannot access 'Controller' before initialization"
at async Promise.all (index 0) {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: AssertionError [ERR_ASSERTION]: Got unwanted exception.
Actual message: "Cannot access 'Controller' before initialization"
at res.<computed> [as doesNotThrow] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:61:7)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:631:25)
at Test.start (node:internal/test_runner/test:542:17)
at node:internal/test_runner/test:946:71
at node:internal/per_context/primordials:487:82
at new Promise (<anonymous>)
at new SafePromise (node:internal/per_context/primordials:455:29)
at node:internal/per_context/primordials:487:9 {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: ReferenceError: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at /home/runner/work/undici/undici/test/mock-pool.js:61:35
at getActual (node:assert:765:5)
at Function.doesNotThrow (node:assert:931:32)
at res.<computed> [as doesNotThrow] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:61:7)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:631:25),
expected: undefined,
operator: 'doesNotThrow'
}
}
|
should directly throw error from mockDispatch function if error is not a MockNotMatchedError:
test/mock-pool.js#L96
[Error [ERR_TEST_FAILURE]: Expected values to be strictly deep-equal:
+ actual - expected
Comparison {
+ message: "Cannot access 'Controller' before initialization",
+ name: 'ReferenceError'
- message: 'kaboom',
- name: 'Error'
}] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected
Comparison {
+ message: "Cannot access 'Controller' before initialization",
+ name: 'ReferenceError'
- message: 'kaboom',
- name: 'Error'
}
at res.<computed> [as throws] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:96:7)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:631:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:374:18)
at Test.postRun (node:internal/test_runner/test:715:19)
at Test.run (node:internal/test_runner/test:673:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:948:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:374:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: ReferenceError: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at /home/runner/work/undici/undici/test/mock-pool.js:96:29
at getActual (node:assert:765:5)
at Function.throws (node:assert:911:24)
at res.<computed> [as throws] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:96:7)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:631:25),
expected: Error: kaboom
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:103:9)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:631:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:374:18)
at Test.postRun (node:internal/test_runner/test:715:19)
at Test.run (node:internal/test_runner/test:673:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:948:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:374:7),
operator: 'throws'
}
}
|
MockPool - should be able to set as globalDispatcher:
test/mock-pool.js#L211
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:168:12)
at /home/runner/work/undici/undici/index.js:91:15
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:211:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
|
MockPool - should be able to use as a local dispatcher:
test/mock-pool.js#L246
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:168:12)
at /home/runner/work/undici/undici/index.js:91:15
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:246:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
|
MockPool - basic intercept with MockPool.request:
test/mock-pool.js#L285
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:168:12)
at TestContext.<anonymous> (/home/runner/work/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:632:9)
}
|
MockPool - correct errors when consuming invalid JSON body:
test/mock-pool.js#L302
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/home/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/home/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/home/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at MockAgent.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
}
|
MockPool - allows matching headers in fetch:
test/mock-pool.js#L348
[Error [ERR_TEST_FAILURE]: fetch failed] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: TypeError [Error]: fetch failed
at fetch (/home/runner/work/undici/undici/index.js:109:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:348:3)
at async Test.run (node:internal/test_runner/test:632:9)
at async Test.processPendingSubtests (node:internal/test_runner/test:374:7) {
[cause]: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/home/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/home/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/home/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at /home/runner/work/undici/undici/lib/web/fetch/index.js:2076:51
at new Promise (<anonymous>)
}
}
|
test/mock-pool.js:
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' }
|
should return MockScope:
test/mock-interceptor.js#L98
Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization
at async Promise.all (index 0) {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-interceptor.js:98:14)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:631:25)
at Test.start (node:internal/test_runner/test:542:17)
at node:internal/test_runner/test:946:71
at node:internal/per_context/primordials:487:82
at new Promise (<anonymous>)
}
|
Variations of persist(), times(), and pending status:
test/mock-interceptor-unused-assertions.js#L112
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/home/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/home/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/home/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at MockAgent.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
}
|
should handle a single interceptor:
test/mock-pool.js#L61
Error [ERR_TEST_FAILURE]: Got unwanted exception.
Actual message: "Cannot access 'Controller' before initialization"
at new Promise (<anonymous>)
at Array.map (<anonymous>) {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: AssertionError [ERR_ASSERTION]: Got unwanted exception.
Actual message: "Cannot access 'Controller' before initialization"
at res.<computed> [as doesNotThrow] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:61:7)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25)
at Test.start (node:internal/test_runner/test:550:17)
at node:internal/test_runner/test:962:71
at node:internal/per_context/primordials:488:82
at new Promise (<anonymous>)
at new SafePromise (node:internal/per_context/primordials:456:29)
at node:internal/per_context/primordials:488:9 {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: ReferenceError: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at /home/runner/work/undici/undici/test/mock-pool.js:61:35
at getActual (node:assert:765:5)
at Function.doesNotThrow (node:assert:931:32)
at res.<computed> [as doesNotThrow] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:61:7)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25),
expected: undefined,
operator: 'doesNotThrow'
}
}
|
should directly throw error from mockDispatch function if error is not a MockNotMatchedError:
test/mock-pool.js#L96
Error [ERR_TEST_FAILURE]: Expected values to be strictly deep-equal:
+ actual - expected
Comparison {
+ message: "Cannot access 'Controller' before initialization",
+ name: 'ReferenceError'
- 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 access 'Controller' before initialization",
+ name: 'ReferenceError'
- message: 'kaboom',
- name: 'Error'
}
at res.<computed> [as throws] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:96:7)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:382:18)
at Test.postRun (node:internal/test_runner/test:730:19)
at Test.run (node:internal/test_runner/test:688:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:964:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:382:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: ReferenceError: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at /home/runner/work/undici/undici/test/mock-pool.js:96:29
at getActual (node:assert:765:5)
at Function.throws (node:assert:911:24)
at res.<computed> [as throws] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:96:7)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25),
expected: Error: kaboom
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:103:9)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:382:18)
at Test.postRun (node:internal/test_runner/test:730:19)
at Test.run (node:internal/test_runner/test:688:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:964:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:382:7),
operator: 'throws'
}
}
|
MockPool - should be able to set as globalDispatcher:
test/mock-pool.js#L211
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:168:12)
at /home/runner/work/undici/undici/index.js:91:15
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:211:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
|
MockPool - should be able to use as a local dispatcher:
test/mock-pool.js#L246
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:168:12)
at /home/runner/work/undici/undici/index.js:91:15
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:246:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
|
MockPool - basic intercept with MockPool.request:
test/mock-pool.js#L285
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:168:12)
at TestContext.<anonymous> (/home/runner/work/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:640:9)
}
|
MockPool - correct errors when consuming invalid JSON body:
test/mock-pool.js#L302
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/home/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/home/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/home/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at MockAgent.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
}
|
MockPool - allows matching headers in fetch:
test/mock-pool.js#L348
[Error [ERR_TEST_FAILURE]: fetch failed] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: TypeError [Error]: fetch failed
at fetch (/home/runner/work/undici/undici/index.js:109:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:348:3)
at async Test.run (node:internal/test_runner/test:640:9)
at async Test.processPendingSubtests (node:internal/test_runner/test:382:7) {
[cause]: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/home/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/home/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/home/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at /home/runner/work/undici/undici/lib/web/fetch/index.js:2076:51
at new Promise (<anonymous>)
}
}
|
test/mock-pool.js:
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' }
|
should return MockScope:
test/mock-interceptor.js#L98
Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization
at new Promise (<anonymous>)
at Array.map (<anonymous>) {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-interceptor.js:98:14)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25)
at Test.start (node:internal/test_runner/test:550:17)
at node:internal/test_runner/test:962:71
at node:internal/per_context/primordials:488:82
at new Promise (<anonymous>)
}
|
Variations of persist(), times(), and pending status:
test/mock-interceptor-unused-assertions.js#L112
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/home/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/home/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/home/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at MockAgent.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
}
|
should handle a single interceptor:
test/mock-pool.js#L61
Error [ERR_TEST_FAILURE]: Got unwanted exception.
Actual message: "Cannot access 'Controller' before initialization"
at async Promise.all (index 0) {
failureType: 'testCodeFailure',
cause: AssertionError [ERR_ASSERTION]: Got unwanted exception.
Actual message: "Cannot access 'Controller' before initialization"
at res.<computed> [as doesNotThrow] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:61:7)
at Test.runInAsyncScope (node:async_hooks:203:9)
at Test.run (node:internal/test_runner/test:631:25)
at Test.start (node:internal/test_runner/test:542:17)
at node:internal/test_runner/test:946:71
at node:internal/per_context/primordials:487:82
at new Promise (<anonymous>)
at new SafePromise (node:internal/per_context/primordials:455:29)
at node:internal/per_context/primordials:487:9 {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: ReferenceError: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at /home/runner/work/undici/undici/test/mock-pool.js:61:35
at getActual (node:assert:756:5)
at Function.doesNotThrow (node:assert:922:32)
at res.<computed> [as doesNotThrow] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:61:7)
at Test.runInAsyncScope (node:async_hooks:203:9)
at Test.run (node:internal/test_runner/test:631:25),
expected: undefined,
operator: 'doesNotThrow'
},
code: 'ERR_TEST_FAILURE'
}
|
should directly throw error from mockDispatch function if error is not a MockNotMatchedError:
test/mock-pool.js#L96
[Error [ERR_TEST_FAILURE]: Expected values to be strictly deep-equal:
+ actual - expected
Comparison {
+ message: "Cannot access 'Controller' before initialization",
+ name: 'ReferenceError'
- message: 'kaboom',
- name: 'Error'
}] {
failureType: 'testCodeFailure',
cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected
Comparison {
+ message: "Cannot access 'Controller' before initialization",
+ name: 'ReferenceError'
- message: 'kaboom',
- name: 'Error'
}
at res.<computed> [as throws] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:96:7)
at Test.runInAsyncScope (node:async_hooks:203:9)
at Test.run (node:internal/test_runner/test:631:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:374:18)
at Test.postRun (node:internal/test_runner/test:715:19)
at Test.run (node:internal/test_runner/test:673:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:948:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:374:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: ReferenceError: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at /home/runner/work/undici/undici/test/mock-pool.js:96:29
at getActual (node:assert:756:5)
at Function.throws (node:assert:902:24)
at res.<computed> [as throws] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:96:7)
at Test.runInAsyncScope (node:async_hooks:203:9)
at Test.run (node:internal/test_runner/test:631:25),
expected: Error: kaboom
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:103:9)
at Test.runInAsyncScope (node:async_hooks:203:9)
at Test.run (node:internal/test_runner/test:631:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:374:18)
at Test.postRun (node:internal/test_runner/test:715:19)
at Test.run (node:internal/test_runner/test:673:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:948:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:374:7),
operator: 'throws'
},
code: 'ERR_TEST_FAILURE'
}
|
MockPool - should be able to set as globalDispatcher:
test/mock-pool.js#L211
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:168:12)
at /home/runner/work/undici/undici/index.js:91:15
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:211:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5),
code: 'ERR_TEST_FAILURE'
}
|
MockPool - should be able to use as a local dispatcher:
test/mock-pool.js#L246
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:168:12)
at /home/runner/work/undici/undici/index.js:91:15
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:246:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5),
code: 'ERR_TEST_FAILURE'
}
|
MockPool - basic intercept with MockPool.request:
test/mock-pool.js#L285
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:168:12)
at TestContext.<anonymous> (/home/runner/work/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:632:9),
code: 'ERR_TEST_FAILURE'
}
|
MockPool - correct errors when consuming invalid JSON body:
test/mock-pool.js#L302
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/home/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/home/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/home/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at MockAgent.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15,
code: 'ERR_TEST_FAILURE'
}
|
MockPool - allows matching headers in fetch:
test/mock-pool.js#L348
[Error [ERR_TEST_FAILURE]: fetch failed] {
failureType: 'testCodeFailure',
cause: TypeError [Error]: fetch failed
at fetch (/home/runner/work/undici/undici/index.js:109:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:348:3)
at async Test.run (node:internal/test_runner/test:632:9)
at async Test.processPendingSubtests (node:internal/test_runner/test:374:7) {
[cause]: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/home/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/home/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/home/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at /home/runner/work/undici/undici/lib/web/fetch/index.js:2076:51
at new Promise (<anonymous>)
},
code: 'ERR_TEST_FAILURE'
}
|
test/mock-pool.js:
test/mock-pool.js#L1
[Error [ERR_TEST_FAILURE]: test timed out after 30000ms] { failureType: 'testTimeoutFailure', cause: 'test timed out after 30000ms', code: 'ERR_TEST_FAILURE' }
|
should return MockScope:
test/mock-interceptor.js#L98
Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization
at async Promise.all (index 0) {
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-interceptor.js:98:14)
at Test.runInAsyncScope (node:async_hooks:203:9)
at Test.run (node:internal/test_runner/test:631:25)
at Test.start (node:internal/test_runner/test:542:17)
at node:internal/test_runner/test:946:71
at node:internal/per_context/primordials:487:82
at new Promise (<anonymous>),
code: 'ERR_TEST_FAILURE'
}
|
Variations of persist(), times(), and pending status:
test/mock-interceptor-unused-assertions.js#L112
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/home/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/home/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/home/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at MockAgent.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15,
code: 'ERR_TEST_FAILURE'
}
|
should handle a single interceptor:
test\mock-pool.js#L61
Error [ERR_TEST_FAILURE]: Got unwanted exception.
Actual message: "Cannot access 'Controller' before initialization"
at new Promise (<anonymous>)
at Array.map (<anonymous>) {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: AssertionError [ERR_ASSERTION]: Got unwanted exception.
Actual message: "Cannot access 'Controller' before initialization"
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:639:25)
at Test.start (node:internal/test_runner/test:550:17)
at node:internal/test_runner/test:962:71
at node:internal/per_context/primordials:488:82
at new Promise (<anonymous>)
at new SafePromise (node:internal/per_context/primordials:456:29)
at node:internal/per_context/primordials:488:9 {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: ReferenceError: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at D:\a\undici\undici\test\mock-pool.js:61:35
at getActual (node:assert:765:5)
at Function.doesNotThrow (node:assert:931: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:639:25),
expected: undefined,
operator: 'doesNotThrow'
}
}
|
should directly throw error from mockDispatch function if error is not a MockNotMatchedError:
test\mock-pool.js#L96
Error [ERR_TEST_FAILURE]: Expected values to be strictly deep-equal:
+ actual - expected
Comparison {
+ message: "Cannot access 'Controller' before initialization",
+ name: 'ReferenceError'
- 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 access 'Controller' before initialization",
+ name: 'ReferenceError'
- 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:639:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:382:18)
at Test.postRun (node:internal/test_runner/test:730:19)
at Test.run (node:internal/test_runner/test:688:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:964:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:382:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: ReferenceError: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at D:\a\undici\undici\test\mock-pool.js:96:29
at getActual (node:assert:765:5)
at Function.throws (node:assert:911: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:639:25),
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:639:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:382:18)
at Test.postRun (node:internal/test_runner/test:730:19)
at Test.run (node:internal/test_runner/test:688:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:964:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:382:7),
operator: 'throws'
}
}
|
MockPool - should be able to set as globalDispatcher:
test\mock-pool.js#L211
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:176:10)
at D:\a\undici\undici\lib\api\api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:168:12)
at D:\a\undici\undici\index.js:91:15
at TestContext.<anonymous> (D:\a\undici\undici\test\mock-pool.js:211:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
|
MockPool - should be able to use as a local dispatcher:
test\mock-pool.js#L246
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:176:10)
at D:\a\undici\undici\lib\api\api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:168:12)
at D:\a\undici\undici\index.js:91:15
at TestContext.<anonymous> (D:\a\undici\undici\test\mock-pool.js:246:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
|
MockPool - basic intercept with MockPool.request:
test\mock-pool.js#L285
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:176:10)
at D:\a\undici\undici\lib\api\api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:168: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:640:9)
}
|
MockPool - correct errors when consuming invalid JSON body:
test\mock-pool.js#L302
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at [dispatch] (D:\a\undici\undici\lib\dispatcher\agent.js:105:23)
at Intercept (D:\a\undici\undici\lib\interceptor\redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (D:\a\undici\undici\lib\dispatcher\dispatcher-base.js:158:12)
at Agent.dispatch (D:\a\undici\undici\lib\dispatcher\dispatcher-base.js:179:40)
at MockAgent.dispatch (D:\a\undici\undici\lib\mock\mock-agent.js:55:25)
at MockAgent.request (D:\a\undici\undici\lib\api\api-request.js:176:10)
at D:\a\undici\undici\lib\api\api-request.js:169:15
}
|
MockPool - allows matching headers in fetch:
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:109: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:640:9)
at async Test.processPendingSubtests (node:internal/test_runner/test:382:7) {
[cause]: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at [dispatch] (D:\a\undici\undici\lib\dispatcher\agent.js:105:23)
at Intercept (D:\a\undici\undici\lib\interceptor\redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (D:\a\undici\undici\lib\dispatcher\dispatcher-base.js:158:12)
at Agent.dispatch (D:\a\undici\undici\lib\dispatcher\dispatcher-base.js:179:40)
at MockAgent.dispatch (D:\a\undici\undici\lib\mock\mock-agent.js:55:25)
at D:\a\undici\undici\lib\web\fetch\index.js:2076:51
at new Promise (<anonymous>)
}
}
|
test\mock-pool.js:
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' }
|
should return MockScope:
test\mock-interceptor.js#L98
Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization
at new Promise (<anonymous>)
at Array.map (<anonymous>) {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at TestContext.<anonymous> (D:\a\undici\undici\test\mock-interceptor.js:98:14)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25)
at Test.start (node:internal/test_runner/test:550:17)
at node:internal/test_runner/test:962:71
at node:internal/per_context/primordials:488:82
at new Promise (<anonymous>)
}
|
Variations of persist(), times(), and pending status:
test\mock-interceptor-unused-assertions.js#L112
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at [dispatch] (D:\a\undici\undici\lib\dispatcher\agent.js:105:23)
at Intercept (D:\a\undici\undici\lib\interceptor\redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (D:\a\undici\undici\lib\dispatcher\dispatcher-base.js:158:12)
at Agent.dispatch (D:\a\undici\undici\lib\dispatcher\dispatcher-base.js:179:40)
at MockAgent.dispatch (D:\a\undici\undici\lib\mock\mock-agent.js:55:25)
at MockAgent.request (D:\a\undici\undici\lib\api\api-request.js:176:10)
at D:\a\undici\undici\lib\api\api-request.js:169:15
}
|
should handle a single interceptor:
test\mock-pool.js#L61
Error [ERR_TEST_FAILURE]: Got unwanted exception.
Actual message: "Cannot access 'Controller' before initialization"
at async Promise.all (index 0) {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: AssertionError [ERR_ASSERTION]: Got unwanted exception.
Actual message: "Cannot access 'Controller' before initialization"
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:631:25)
at Test.start (node:internal/test_runner/test:542:17)
at node:internal/test_runner/test:946:71
at node:internal/per_context/primordials:487:82
at new Promise (<anonymous>)
at new SafePromise (node:internal/per_context/primordials:455:29)
at node:internal/per_context/primordials:487:9 {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: ReferenceError: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at D:\a\undici\undici\test\mock-pool.js:61:35
at getActual (node:assert:765:5)
at Function.doesNotThrow (node:assert:931: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:631:25),
expected: undefined,
operator: 'doesNotThrow'
}
}
|
should directly throw error from mockDispatch function if error is not a MockNotMatchedError:
test\mock-pool.js#L96
[Error [ERR_TEST_FAILURE]: Expected values to be strictly deep-equal:
+ actual - expected
Comparison {
+ message: "Cannot access 'Controller' before initialization",
+ name: 'ReferenceError'
- message: 'kaboom',
- name: 'Error'
}] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected
Comparison {
+ message: "Cannot access 'Controller' before initialization",
+ name: 'ReferenceError'
- 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:631:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:374:18)
at Test.postRun (node:internal/test_runner/test:715:19)
at Test.run (node:internal/test_runner/test:673:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:948:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:374:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: ReferenceError: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at D:\a\undici\undici\test\mock-pool.js:96:29
at getActual (node:assert:765:5)
at Function.throws (node:assert:911: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:631:25),
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:631:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:374:18)
at Test.postRun (node:internal/test_runner/test:715:19)
at Test.run (node:internal/test_runner/test:673:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:948:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:374:7),
operator: 'throws'
}
}
|
MockPool - should be able to set as globalDispatcher:
test\mock-pool.js#L211
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:176:10)
at D:\a\undici\undici\lib\api\api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:168:12)
at D:\a\undici\undici\index.js:91:15
at TestContext.<anonymous> (D:\a\undici\undici\test\mock-pool.js:211:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
|
MockPool - should be able to use as a local dispatcher:
test\mock-pool.js#L246
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:176:10)
at D:\a\undici\undici\lib\api\api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:168:12)
at D:\a\undici\undici\index.js:91:15
at TestContext.<anonymous> (D:\a\undici\undici\test\mock-pool.js:246:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
|
MockPool - basic intercept with MockPool.request:
test\mock-pool.js#L285
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:176:10)
at D:\a\undici\undici\lib\api\api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:168: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:632:9)
}
|
MockPool - correct errors when consuming invalid JSON body:
test\mock-pool.js#L302
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at [dispatch] (D:\a\undici\undici\lib\dispatcher\agent.js:105:23)
at Intercept (D:\a\undici\undici\lib\interceptor\redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (D:\a\undici\undici\lib\dispatcher\dispatcher-base.js:158:12)
at Agent.dispatch (D:\a\undici\undici\lib\dispatcher\dispatcher-base.js:179:40)
at MockAgent.dispatch (D:\a\undici\undici\lib\mock\mock-agent.js:55:25)
at MockAgent.request (D:\a\undici\undici\lib\api\api-request.js:176:10)
at D:\a\undici\undici\lib\api\api-request.js:169:15
}
|
MockPool - allows matching headers in fetch:
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:109: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:632:9)
at async Test.processPendingSubtests (node:internal/test_runner/test:374:7) {
[cause]: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at [dispatch] (D:\a\undici\undici\lib\dispatcher\agent.js:105:23)
at Intercept (D:\a\undici\undici\lib\interceptor\redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (D:\a\undici\undici\lib\dispatcher\dispatcher-base.js:158:12)
at Agent.dispatch (D:\a\undici\undici\lib\dispatcher\dispatcher-base.js:179:40)
at MockAgent.dispatch (D:\a\undici\undici\lib\mock\mock-agent.js:55:25)
at D:\a\undici\undici\lib\web\fetch\index.js:2076:51
at new Promise (<anonymous>)
}
}
|
test\mock-pool.js:
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' }
|
should return MockScope:
test\mock-interceptor.js#L98
Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization
at async Promise.all (index 0) {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at TestContext.<anonymous> (D:\a\undici\undici\test\mock-interceptor.js:98:14)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:631:25)
at Test.start (node:internal/test_runner/test:542:17)
at node:internal/test_runner/test:946:71
at node:internal/per_context/primordials:487:82
at new Promise (<anonymous>)
}
|
Variations of persist(), times(), and pending status:
test\mock-interceptor-unused-assertions.js#L112
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at [dispatch] (D:\a\undici\undici\lib\dispatcher\agent.js:105:23)
at Intercept (D:\a\undici\undici\lib\interceptor\redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (D:\a\undici\undici\lib\dispatcher\dispatcher-base.js:158:12)
at Agent.dispatch (D:\a\undici\undici\lib\dispatcher\dispatcher-base.js:179:40)
at MockAgent.dispatch (D:\a\undici\undici\lib\mock\mock-agent.js:55:25)
at MockAgent.request (D:\a\undici\undici\lib\api\api-request.js:176:10)
at D:\a\undici\undici\lib\api\api-request.js:169:15
}
|
should handle a single interceptor:
test/mock-pool.js#L61
Error [ERR_TEST_FAILURE]: Got unwanted exception.
Actual message: "Cannot access 'Controller' before initialization"
at async Promise.all (index 0) {
failureType: 'testCodeFailure',
cause: AssertionError [ERR_ASSERTION]: Got unwanted exception.
Actual message: "Cannot access 'Controller' before initialization"
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:203:9)
at Test.run (node:internal/test_runner/test:631:25)
at Test.start (node:internal/test_runner/test:542:17)
at node:internal/test_runner/test:946:71
at node:internal/per_context/primordials:487:82
at new Promise (<anonymous>)
at new SafePromise (node:internal/per_context/primordials:455:29)
at node:internal/per_context/primordials:487:9 {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: ReferenceError: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at /Users/runner/work/undici/undici/test/mock-pool.js:61:35
at getActual (node:assert:756:5)
at Function.doesNotThrow (node:assert:922: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:203:9)
at Test.run (node:internal/test_runner/test:631:25),
expected: undefined,
operator: 'doesNotThrow'
},
code: 'ERR_TEST_FAILURE'
}
|
should directly throw error from mockDispatch function if error is not a MockNotMatchedError:
test/mock-pool.js#L96
[Error [ERR_TEST_FAILURE]: Expected values to be strictly deep-equal:
+ actual - expected
Comparison {
+ message: "Cannot access 'Controller' before initialization",
+ name: 'ReferenceError'
- message: 'kaboom',
- name: 'Error'
}] {
failureType: 'testCodeFailure',
cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected
Comparison {
+ message: "Cannot access 'Controller' before initialization",
+ name: 'ReferenceError'
- 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:203:9)
at Test.run (node:internal/test_runner/test:631:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:374:18)
at Test.postRun (node:internal/test_runner/test:715:19)
at Test.run (node:internal/test_runner/test:673:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:948:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:374:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: ReferenceError: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at /Users/runner/work/undici/undici/test/mock-pool.js:96:29
at getActual (node:assert:756:5)
at Function.throws (node:assert:902: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:203:9)
at Test.run (node:internal/test_runner/test:631:25),
expected: Error: kaboom
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-pool.js:103:9)
at Test.runInAsyncScope (node:async_hooks:203:9)
at Test.run (node:internal/test_runner/test:631:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:374:18)
at Test.postRun (node:internal/test_runner/test:715:19)
at Test.run (node:internal/test_runner/test:673:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:948:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:374:7),
operator: 'throws'
},
code: 'ERR_TEST_FAILURE'
}
|
MockPool - should be able to set as globalDispatcher:
test/mock-pool.js#L211
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /Users/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:168:12)
at /Users/runner/work/undici/undici/index.js:91:15
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-pool.js:211:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5),
code: 'ERR_TEST_FAILURE'
}
|
MockPool - should be able to use as a local dispatcher:
test/mock-pool.js#L246
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /Users/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:168:12)
at /Users/runner/work/undici/undici/index.js:91:15
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-pool.js:246:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5),
code: 'ERR_TEST_FAILURE'
}
|
MockPool - basic intercept with MockPool.request:
test/mock-pool.js#L285
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /Users/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:168:12)
at TestContext.<anonymous> (/Users/runner/work/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:632:9),
code: 'ERR_TEST_FAILURE'
}
|
MockPool - correct errors when consuming invalid JSON body:
test/mock-pool.js#L302
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/Users/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/Users/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/Users/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/Users/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at MockAgent.request (/Users/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /Users/runner/work/undici/undici/lib/api/api-request.js:169:15,
code: 'ERR_TEST_FAILURE'
}
|
MockPool - allows matching headers in fetch:
test/mock-pool.js#L348
[Error [ERR_TEST_FAILURE]: fetch failed] {
failureType: 'testCodeFailure',
cause: TypeError [Error]: fetch failed
at fetch (/Users/runner/work/undici/undici/index.js:109:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95: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:632:9)
at async Test.processPendingSubtests (node:internal/test_runner/test:374:7) {
[cause]: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/Users/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/Users/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/Users/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/Users/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at /Users/runner/work/undici/undici/lib/web/fetch/index.js:2076:51
at new Promise (<anonymous>)
},
code: 'ERR_TEST_FAILURE'
}
|
test/mock-pool.js:
test/mock-pool.js#L1
[Error [ERR_TEST_FAILURE]: test timed out after 30000ms] { failureType: 'testTimeoutFailure', cause: 'test timed out after 30000ms', code: 'ERR_TEST_FAILURE' }
|
should return MockScope:
test/mock-interceptor.js#L98
Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization
at async Promise.all (index 0) {
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-interceptor.js:98:14)
at Test.runInAsyncScope (node:async_hooks:203:9)
at Test.run (node:internal/test_runner/test:631:25)
at Test.start (node:internal/test_runner/test:542:17)
at node:internal/test_runner/test:946:71
at node:internal/per_context/primordials:487:82
at new Promise (<anonymous>),
code: 'ERR_TEST_FAILURE'
}
|
Variations of persist(), times(), and pending status:
test/mock-interceptor-unused-assertions.js#L112
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/Users/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/Users/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/Users/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/Users/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at MockAgent.request (/Users/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /Users/runner/work/undici/undici/lib/api/api-request.js:169:15,
code: 'ERR_TEST_FAILURE'
}
|
should handle a single interceptor:
test\mock-pool.js#L61
Error [ERR_TEST_FAILURE]: Got unwanted exception.
Actual message: "Cannot access 'Controller' before initialization"
at async Promise.all (index 0) {
failureType: 'testCodeFailure',
cause: AssertionError [ERR_ASSERTION]: Got unwanted exception.
Actual message: "Cannot access 'Controller' before initialization"
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:203:9)
at Test.run (node:internal/test_runner/test:631:25)
at Test.start (node:internal/test_runner/test:542:17)
at node:internal/test_runner/test:946:71
at node:internal/per_context/primordials:487:82
at new Promise (<anonymous>)
at new SafePromise (node:internal/per_context/primordials:455:29)
at node:internal/per_context/primordials:487:9 {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: ReferenceError: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at D:\a\undici\undici\test\mock-pool.js:61:35
at getActual (node:assert:756:5)
at Function.doesNotThrow (node:assert:922: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:203:9)
at Test.run (node:internal/test_runner/test:631:25),
expected: undefined,
operator: 'doesNotThrow'
},
code: 'ERR_TEST_FAILURE'
}
|
should directly throw error from mockDispatch function if error is not a MockNotMatchedError:
test\mock-pool.js#L96
[Error [ERR_TEST_FAILURE]: Expected values to be strictly deep-equal:
+ actual - expected
Comparison {
+ message: "Cannot access 'Controller' before initialization",
+ name: 'ReferenceError'
- message: 'kaboom',
- name: 'Error'
}] {
failureType: 'testCodeFailure',
cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected
Comparison {
+ message: "Cannot access 'Controller' before initialization",
+ name: 'ReferenceError'
- 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:203:9)
at Test.run (node:internal/test_runner/test:631:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:374:18)
at Test.postRun (node:internal/test_runner/test:715:19)
at Test.run (node:internal/test_runner/test:673:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:948:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:374:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: ReferenceError: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at D:\a\undici\undici\test\mock-pool.js:96:29
at getActual (node:assert:756:5)
at Function.throws (node:assert:902: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:203:9)
at Test.run (node:internal/test_runner/test:631:25),
expected: Error: kaboom
at TestContext.<anonymous> (D:\a\undici\undici\test\mock-pool.js:103:9)
at Test.runInAsyncScope (node:async_hooks:203:9)
at Test.run (node:internal/test_runner/test:631:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:374:18)
at Test.postRun (node:internal/test_runner/test:715:19)
at Test.run (node:internal/test_runner/test:673:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:948:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:374:7),
operator: 'throws'
},
code: 'ERR_TEST_FAILURE'
}
|
MockPool - should be able to set as globalDispatcher:
test\mock-pool.js#L211
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:176:10)
at D:\a\undici\undici\lib\api\api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:168:12)
at D:\a\undici\undici\index.js:91:15
at TestContext.<anonymous> (D:\a\undici\undici\test\mock-pool.js:211:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5),
code: 'ERR_TEST_FAILURE'
}
|
MockPool - should be able to use as a local dispatcher:
test\mock-pool.js#L246
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:176:10)
at D:\a\undici\undici\lib\api\api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:168:12)
at D:\a\undici\undici\index.js:91:15
at TestContext.<anonymous> (D:\a\undici\undici\test\mock-pool.js:246:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5),
code: 'ERR_TEST_FAILURE'
}
|
MockPool - basic intercept with MockPool.request:
test\mock-pool.js#L285
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:176:10)
at D:\a\undici\undici\lib\api\api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (D:\a\undici\undici\lib\api\api-request.js:168: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:632:9),
code: 'ERR_TEST_FAILURE'
}
|
MockPool - correct errors when consuming invalid JSON body:
test\mock-pool.js#L302
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at [dispatch] (D:\a\undici\undici\lib\dispatcher\agent.js:105:23)
at Intercept (D:\a\undici\undici\lib\interceptor\redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (D:\a\undici\undici\lib\dispatcher\dispatcher-base.js:158:12)
at Agent.dispatch (D:\a\undici\undici\lib\dispatcher\dispatcher-base.js:179:40)
at MockAgent.dispatch (D:\a\undici\undici\lib\mock\mock-agent.js:55:25)
at MockAgent.request (D:\a\undici\undici\lib\api\api-request.js:176:10)
at D:\a\undici\undici\lib\api\api-request.js:169:15,
code: 'ERR_TEST_FAILURE'
}
|
MockPool - allows matching headers in fetch:
test\mock-pool.js#L348
[Error [ERR_TEST_FAILURE]: fetch failed] {
failureType: 'testCodeFailure',
cause: TypeError [Error]: fetch failed
at fetch (D:\a\undici\undici\index.js:109: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:632:9)
at async Test.processPendingSubtests (node:internal/test_runner/test:374:7) {
[cause]: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at [dispatch] (D:\a\undici\undici\lib\dispatcher\agent.js:105:23)
at Intercept (D:\a\undici\undici\lib\interceptor\redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (D:\a\undici\undici\lib\dispatcher\dispatcher-base.js:158:12)
at Agent.dispatch (D:\a\undici\undici\lib\dispatcher\dispatcher-base.js:179:40)
at MockAgent.dispatch (D:\a\undici\undici\lib\mock\mock-agent.js:55:25)
at D:\a\undici\undici\lib\web\fetch\index.js:2076:51
at new Promise (<anonymous>)
},
code: 'ERR_TEST_FAILURE'
}
|
test\mock-pool.js:
test\mock-pool.js#L1
[Error [ERR_TEST_FAILURE]: test timed out after 30000ms] { failureType: 'testTimeoutFailure', cause: 'test timed out after 30000ms', code: 'ERR_TEST_FAILURE' }
|
should return MockScope:
test\mock-interceptor.js#L98
Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization
at async Promise.all (index 0) {
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at TestContext.<anonymous> (D:\a\undici\undici\test\mock-interceptor.js:98:14)
at Test.runInAsyncScope (node:async_hooks:203:9)
at Test.run (node:internal/test_runner/test:631:25)
at Test.start (node:internal/test_runner/test:542:17)
at node:internal/test_runner/test:946:71
at node:internal/per_context/primordials:487:82
at new Promise (<anonymous>),
code: 'ERR_TEST_FAILURE'
}
|
Variations of persist(), times(), and pending status:
test\mock-interceptor-unused-assertions.js#L112
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (D:\a\undici\undici\lib\mock\mock-utils.js:288:24)
at MockPool.mockDispatch (D:\a\undici\undici\lib\mock\mock-utils.js:261:5)
at MockPool.dispatch (D:\a\undici\undici\lib\mock\mock-utils.js:326:22)
at [dispatch] (D:\a\undici\undici\lib\dispatcher\agent.js:105:23)
at Intercept (D:\a\undici\undici\lib\interceptor\redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (D:\a\undici\undici\lib\dispatcher\dispatcher-base.js:158:12)
at Agent.dispatch (D:\a\undici\undici\lib\dispatcher\dispatcher-base.js:179:40)
at MockAgent.dispatch (D:\a\undici\undici\lib\mock\mock-agent.js:55:25)
at MockAgent.request (D:\a\undici\undici\lib\api\api-request.js:176:10)
at D:\a\undici\undici\lib\api\api-request.js:169:15,
code: 'ERR_TEST_FAILURE'
}
|
should handle a single interceptor:
test/mock-pool.js#L61
Error [ERR_TEST_FAILURE]: Got unwanted exception.
Actual message: "Cannot access 'Controller' before initialization"
at new Promise (<anonymous>)
at Array.map (<anonymous>) {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: AssertionError [ERR_ASSERTION]: Got unwanted exception.
Actual message: "Cannot access 'Controller' before initialization"
at res.<computed> [as doesNotThrow] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:61:7)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25)
at Test.start (node:internal/test_runner/test:550:17)
at node:internal/test_runner/test:962:71
at node:internal/per_context/primordials:488:82
at new Promise (<anonymous>)
at new SafePromise (node:internal/per_context/primordials:456:29)
at node:internal/per_context/primordials:488:9 {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: ReferenceError: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at /home/runner/work/undici/undici/test/mock-pool.js:61:35
at getActual (node:assert:765:5)
at Function.doesNotThrow (node:assert:931:32)
at res.<computed> [as doesNotThrow] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:61:7)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25),
expected: undefined,
operator: 'doesNotThrow'
}
}
|
should directly throw error from mockDispatch function if error is not a MockNotMatchedError:
test/mock-pool.js#L96
Error [ERR_TEST_FAILURE]: Expected values to be strictly deep-equal:
+ actual - expected
Comparison {
+ message: "Cannot access 'Controller' before initialization",
+ name: 'ReferenceError'
- 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 access 'Controller' before initialization",
+ name: 'ReferenceError'
- message: 'kaboom',
- name: 'Error'
}
at res.<computed> [as throws] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:96:7)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:382:18)
at Test.postRun (node:internal/test_runner/test:730:19)
at Test.run (node:internal/test_runner/test:688:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:964:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:382:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: ReferenceError: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at /home/runner/work/undici/undici/test/mock-pool.js:96:29
at getActual (node:assert:765:5)
at Function.throws (node:assert:911:24)
at res.<computed> [as throws] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:96:7)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25),
expected: Error: kaboom
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:103:9)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:382:18)
at Test.postRun (node:internal/test_runner/test:730:19)
at Test.run (node:internal/test_runner/test:688:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:964:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:382:7),
operator: 'throws'
}
}
|
MockPool - should be able to set as globalDispatcher:
test/mock-pool.js#L211
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:168:12)
at /home/runner/work/undici/undici/index.js:91:15
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:211:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
|
MockPool - should be able to use as a local dispatcher:
test/mock-pool.js#L246
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:168:12)
at /home/runner/work/undici/undici/index.js:91:15
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:246:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
|
MockPool - basic intercept with MockPool.request:
test/mock-pool.js#L285
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:168:12)
at TestContext.<anonymous> (/home/runner/work/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:640:9)
}
|
MockPool - correct errors when consuming invalid JSON body:
test/mock-pool.js#L302
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/home/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/home/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/home/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at MockAgent.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
}
|
MockPool - allows matching headers in fetch:
test/mock-pool.js#L348
[Error [ERR_TEST_FAILURE]: fetch failed] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: TypeError [Error]: fetch failed
at fetch (/home/runner/work/undici/undici/index.js:109:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:348:3)
at async Test.run (node:internal/test_runner/test:640:9)
at async Test.processPendingSubtests (node:internal/test_runner/test:382:7) {
[cause]: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/home/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/home/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/home/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at /home/runner/work/undici/undici/lib/web/fetch/index.js:2076:51
at new Promise (<anonymous>)
}
}
|
test/mock-pool.js:
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' }
|
should return MockScope:
test/mock-interceptor.js#L98
Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization
at new Promise (<anonymous>)
at Array.map (<anonymous>) {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-interceptor.js:98:14)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25)
at Test.start (node:internal/test_runner/test:550:17)
at node:internal/test_runner/test:962:71
at node:internal/per_context/primordials:488:82
at new Promise (<anonymous>)
}
|
Variations of persist(), times(), and pending status:
test/mock-interceptor-unused-assertions.js#L112
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/home/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/home/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/home/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at MockAgent.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
}
|
should handle a single interceptor:
test/mock-pool.js#L61
Error [ERR_TEST_FAILURE]: Got unwanted exception.
Actual message: "Cannot access 'Controller' before initialization"
at new Promise (<anonymous>)
at Array.map (<anonymous>) {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: AssertionError [ERR_ASSERTION]: Got unwanted exception.
Actual message: "Cannot access 'Controller' before initialization"
at res.<computed> [as doesNotThrow] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:61:7)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25)
at Test.start (node:internal/test_runner/test:550:17)
at node:internal/test_runner/test:962:71
at node:internal/per_context/primordials:487:82
at new Promise (<anonymous>)
at new SafePromise (node:internal/per_context/primordials:455:29)
at node:internal/per_context/primordials:487:9 {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: ReferenceError: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at /home/runner/work/undici/undici/test/mock-pool.js:61:35
at getActual (node:assert:765:5)
at Function.doesNotThrow (node:assert:931:32)
at res.<computed> [as doesNotThrow] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:61:7)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25),
expected: undefined,
operator: 'doesNotThrow'
}
}
|
should directly throw error from mockDispatch function if error is not a MockNotMatchedError:
test/mock-pool.js#L96
Error [ERR_TEST_FAILURE]: Expected values to be strictly deep-equal:
+ actual - expected
Comparison {
+ message: "Cannot access 'Controller' before initialization",
+ name: 'ReferenceError'
- 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 access 'Controller' before initialization",
+ name: 'ReferenceError'
- message: 'kaboom',
- name: 'Error'
}
at res.<computed> [as throws] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:96:7)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:382:18)
at Test.postRun (node:internal/test_runner/test:730:19)
at Test.run (node:internal/test_runner/test:688:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:964:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:382:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: ReferenceError: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at /home/runner/work/undici/undici/test/mock-pool.js:96:29
at getActual (node:assert:765:5)
at Function.throws (node:assert:911:24)
at res.<computed> [as throws] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:96:7)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25),
expected: Error: kaboom
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:103:9)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:382:18)
at Test.postRun (node:internal/test_runner/test:730:19)
at Test.run (node:internal/test_runner/test:688:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:964:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:382:7),
operator: 'throws'
}
}
|
MockPool - should be able to set as globalDispatcher:
test/mock-pool.js#L211
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:168:12)
at /home/runner/work/undici/undici/index.js:91:15
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:211:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
|
MockPool - should be able to use as a local dispatcher:
test/mock-pool.js#L246
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:168:12)
at /home/runner/work/undici/undici/index.js:91:15
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:246:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
|
MockPool - basic intercept with MockPool.request:
test/mock-pool.js#L285
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/home/runner/work/undici/undici/lib/api/api-request.js:168:12)
at TestContext.<anonymous> (/home/runner/work/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:640:9)
}
|
MockPool - correct errors when consuming invalid JSON body:
test/mock-pool.js#L302
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/home/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/home/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/home/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at MockAgent.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
}
|
MockPool - allows matching headers in fetch:
test/mock-pool.js#L348
[Error [ERR_TEST_FAILURE]: fetch failed] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: TypeError [Error]: fetch failed
at fetch (/home/runner/work/undici/undici/index.js:109:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-pool.js:348:3)
at async Test.run (node:internal/test_runner/test:640:9)
at async Test.processPendingSubtests (node:internal/test_runner/test:382:7) {
[cause]: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/home/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/home/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/home/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at /home/runner/work/undici/undici/lib/web/fetch/index.js:2076:51
at new Promise (<anonymous>)
}
}
|
test/mock-pool.js:
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' }
|
should return MockScope:
test/mock-interceptor.js#L98
Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization
at new Promise (<anonymous>)
at Array.map (<anonymous>) {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at TestContext.<anonymous> (/home/runner/work/undici/undici/test/mock-interceptor.js:98:14)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25)
at Test.start (node:internal/test_runner/test:550:17)
at node:internal/test_runner/test:962:71
at node:internal/per_context/primordials:487:82
at new Promise (<anonymous>)
}
|
Variations of persist(), times(), and pending status:
test/mock-interceptor-unused-assertions.js#L112
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/home/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/home/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/home/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/home/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/home/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/home/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at MockAgent.request (/home/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /home/runner/work/undici/undici/lib/api/api-request.js:169:15
}
|
should handle a single interceptor:
test/mock-pool.js#L61
Error [ERR_TEST_FAILURE]: Got unwanted exception.
Actual message: "Cannot access 'Controller' before initialization"
at new Promise (<anonymous>)
at Array.map (<anonymous>) {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: AssertionError [ERR_ASSERTION]: Got unwanted exception.
Actual message: "Cannot access 'Controller' before initialization"
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:206:9)
at Test.run (node:internal/test_runner/test:639:25)
at Test.start (node:internal/test_runner/test:550:17)
at node:internal/test_runner/test:962:71
at node:internal/per_context/primordials:488:82
at new Promise (<anonymous>)
at new SafePromise (node:internal/per_context/primordials:456:29)
at node:internal/per_context/primordials:488:9 {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: ReferenceError: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at /Users/runner/work/undici/undici/test/mock-pool.js:61:35
at getActual (node:assert:765:5)
at Function.doesNotThrow (node:assert:931: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:206:9)
at Test.run (node:internal/test_runner/test:639:25),
expected: undefined,
operator: 'doesNotThrow'
}
}
|
should directly throw error from mockDispatch function if error is not a MockNotMatchedError:
test/mock-pool.js#L96
Error [ERR_TEST_FAILURE]: Expected values to be strictly deep-equal:
+ actual - expected
Comparison {
+ message: "Cannot access 'Controller' before initialization",
+ name: 'ReferenceError'
- 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 access 'Controller' before initialization",
+ name: 'ReferenceError'
- 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:206:9)
at Test.run (node:internal/test_runner/test:639:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:382:18)
at Test.postRun (node:internal/test_runner/test:730:19)
at Test.run (node:internal/test_runner/test:688:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:964:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:382:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: ReferenceError: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at /Users/runner/work/undici/undici/test/mock-pool.js:96:29
at getActual (node:assert:765:5)
at Function.throws (node:assert:911: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:206:9)
at Test.run (node:internal/test_runner/test:639:25),
expected: Error: kaboom
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-pool.js:103:9)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:382:18)
at Test.postRun (node:internal/test_runner/test:730:19)
at Test.run (node:internal/test_runner/test:688:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:964:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:382:7),
operator: 'throws'
}
}
|
MockPool - should be able to set as globalDispatcher:
test/mock-pool.js#L211
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /Users/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:168:12)
at /Users/runner/work/undici/undici/index.js:91:15
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-pool.js:211:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
|
MockPool - should be able to use as a local dispatcher:
test/mock-pool.js#L246
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /Users/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:168:12)
at /Users/runner/work/undici/undici/index.js:91:15
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-pool.js:246:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
|
MockPool - basic intercept with MockPool.request:
test/mock-pool.js#L285
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /Users/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:168:12)
at TestContext.<anonymous> (/Users/runner/work/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:640:9)
}
|
MockPool - correct errors when consuming invalid JSON body:
test/mock-pool.js#L302
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/Users/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/Users/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/Users/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/Users/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at MockAgent.request (/Users/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /Users/runner/work/undici/undici/lib/api/api-request.js:169:15
}
|
MockPool - allows matching headers in fetch:
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:109:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95: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:640:9)
at async Test.processPendingSubtests (node:internal/test_runner/test:382:7) {
[cause]: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/Users/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/Users/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/Users/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/Users/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at /Users/runner/work/undici/undici/lib/web/fetch/index.js:2076:51
at new Promise (<anonymous>)
}
}
|
test/mock-pool.js:
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' }
|
should return MockScope:
test/mock-interceptor.js#L98
Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization
at new Promise (<anonymous>)
at Array.map (<anonymous>) {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-interceptor.js:98:14)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25)
at Test.start (node:internal/test_runner/test:550:17)
at node:internal/test_runner/test:962:71
at node:internal/per_context/primordials:488:82
at new Promise (<anonymous>)
}
|
Variations of persist(), times(), and pending status:
test/mock-interceptor-unused-assertions.js#L112
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/Users/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/Users/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/Users/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/Users/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at MockAgent.request (/Users/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /Users/runner/work/undici/undici/lib/api/api-request.js:169:15
}
|
should handle a single interceptor:
test/mock-pool.js#L61
Error [ERR_TEST_FAILURE]: Got unwanted exception.
Actual message: "Cannot access 'Controller' before initialization"
at new Promise (<anonymous>)
at Array.map (<anonymous>) {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: AssertionError [ERR_ASSERTION]: Got unwanted exception.
Actual message: "Cannot access 'Controller' before initialization"
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:206:9)
at Test.run (node:internal/test_runner/test:639:25)
at Test.start (node:internal/test_runner/test:550:17)
at node:internal/test_runner/test:962:71
at node:internal/per_context/primordials:487:82
at new Promise (<anonymous>)
at new SafePromise (node:internal/per_context/primordials:455:29)
at node:internal/per_context/primordials:487:9 {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: ReferenceError: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at /Users/runner/work/undici/undici/test/mock-pool.js:61:35
at getActual (node:assert:765:5)
at Function.doesNotThrow (node:assert:931: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:206:9)
at Test.run (node:internal/test_runner/test:639:25),
expected: undefined,
operator: 'doesNotThrow'
}
}
|
should directly throw error from mockDispatch function if error is not a MockNotMatchedError:
test/mock-pool.js#L96
Error [ERR_TEST_FAILURE]: Expected values to be strictly deep-equal:
+ actual - expected
Comparison {
+ message: "Cannot access 'Controller' before initialization",
+ name: 'ReferenceError'
- 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 access 'Controller' before initialization",
+ name: 'ReferenceError'
- 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:206:9)
at Test.run (node:internal/test_runner/test:639:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:382:18)
at Test.postRun (node:internal/test_runner/test:730:19)
at Test.run (node:internal/test_runner/test:688:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:964:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:382:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: ReferenceError: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at /Users/runner/work/undici/undici/test/mock-pool.js:96:29
at getActual (node:assert:765:5)
at Function.throws (node:assert:911: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:206:9)
at Test.run (node:internal/test_runner/test:639:25),
expected: Error: kaboom
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-pool.js:103:9)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25)
at Suite.processPendingSubtests (node:internal/test_runner/test:382:18)
at Test.postRun (node:internal/test_runner/test:730:19)
at Test.run (node:internal/test_runner/test:688:12)
at async Promise.all (index 0)
at async Suite.run (node:internal/test_runner/test:964:7)
at async Test.processPendingSubtests (node:internal/test_runner/test:382:7),
operator: 'throws'
}
}
|
MockPool - should be able to set as globalDispatcher:
test/mock-pool.js#L211
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /Users/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:168:12)
at /Users/runner/work/undici/undici/index.js:91:15
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-pool.js:211:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
|
MockPool - should be able to use as a local dispatcher:
test/mock-pool.js#L246
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /Users/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:168:12)
at /Users/runner/work/undici/undici/index.js:91:15
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-pool.js:246:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
|
MockPool - basic intercept with MockPool.request:
test/mock-pool.js#L285
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /Users/runner/work/undici/undici/lib/api/api-request.js:169:15
at new Promise (<anonymous>)
at MockPool.request (/Users/runner/work/undici/undici/lib/api/api-request.js:168:12)
at TestContext.<anonymous> (/Users/runner/work/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:640:9)
}
|
MockPool - correct errors when consuming invalid JSON body:
test/mock-pool.js#L302
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/Users/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/Users/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/Users/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/Users/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at MockAgent.request (/Users/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /Users/runner/work/undici/undici/lib/api/api-request.js:169:15
}
|
MockPool - allows matching headers in fetch:
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:109:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95: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:640:9)
at async Test.processPendingSubtests (node:internal/test_runner/test:382:7) {
[cause]: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/Users/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/Users/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/Users/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/Users/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at /Users/runner/work/undici/undici/lib/web/fetch/index.js:2076:51
at new Promise (<anonymous>)
}
}
|
test/mock-pool.js:
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' }
|
should return MockScope:
test/mock-interceptor.js#L98
Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization
at new Promise (<anonymous>)
at Array.map (<anonymous>) {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/mock-interceptor.js:98:14)
at Test.runInAsyncScope (node:async_hooks:206:9)
at Test.run (node:internal/test_runner/test:639:25)
at Test.start (node:internal/test_runner/test:550:17)
at node:internal/test_runner/test:962:71
at node:internal/per_context/primordials:487:82
at new Promise (<anonymous>)
}
|
Variations of persist(), times(), and pending status:
test/mock-interceptor-unused-assertions.js#L112
[Error [ERR_TEST_FAILURE]: Cannot access 'Controller' before initialization] {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: ReferenceError [Error]: Cannot access 'Controller' before initialization
at handleReply (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:288:24)
at MockPool.mockDispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:261:5)
at MockPool.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-utils.js:326:22)
at [dispatch] (/Users/runner/work/undici/undici/lib/dispatcher/agent.js:105:23)
at Intercept (/Users/runner/work/undici/undici/lib/interceptor/redirect-interceptor.js:11:16)
at [Intercepted Dispatch] (/Users/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:158:12)
at Agent.dispatch (/Users/runner/work/undici/undici/lib/dispatcher/dispatcher-base.js:179:40)
at MockAgent.dispatch (/Users/runner/work/undici/undici/lib/mock/mock-agent.js:55:25)
at MockAgent.request (/Users/runner/work/undici/undici/lib/api/api-request.js:176:10)
at /Users/runner/work/undici/undici/lib/api/api-request.js:169:15
}
|
test (20, ubuntu-latest) / Test with Node.js 20 on ubuntu-latest
Total Tests: 739
Suites 📂: 50
Passed ✅: 653
Failed ❌: 78
Canceled 🚫: 5
Skipped ⏭️: 3
Todo 📝: 0
Duration 🕐: 82712.499ms
|
test (21, ubuntu-latest) / Test with Node.js 21 on ubuntu-latest
Total Tests: 739
Suites 📂: 50
Passed ✅: 653
Failed ❌: 78
Canceled 🚫: 5
Skipped ⏭️: 3
Todo 📝: 0
Duration 🕐: 82353.602ms
|
test (18, ubuntu-latest) / Test with Node.js 18 on ubuntu-latest
Total Tests: 739
Suites 📂: 50
Passed ✅: 653
Failed ❌: 78
Canceled 🚫: 5
Skipped ⏭️: 3
Todo 📝: 0
Duration 🕐: 82478.319ms
|
test (21, windows-latest) / Test with Node.js 21 on windows-latest
Total Tests: 739
Suites 📂: 50
Passed ✅: 653
Failed ❌: 78
Canceled 🚫: 5
Skipped ⏭️: 3
Todo 📝: 0
Duration 🕐: 85550.597ms
|
test (20, windows-latest) / Test with Node.js 20 on windows-latest
Total Tests: 739
Suites 📂: 50
Passed ✅: 653
Failed ❌: 78
Canceled 🚫: 5
Skipped ⏭️: 3
Todo 📝: 0
Duration 🕐: 87346.287ms
|
test (18, macos-latest) / Test with Node.js 18 on macos-latest
Total Tests: 739
Suites 📂: 50
Passed ✅: 653
Failed ❌: 78
Canceled 🚫: 5
Skipped ⏭️: 3
Todo 📝: 0
Duration 🕐: 102238.113ms
|
test (18, windows-latest) / Test with Node.js 18 on windows-latest
Total Tests: 739
Suites 📂: 50
Passed ✅: 653
Failed ❌: 78
Canceled 🚫: 5
Skipped ⏭️: 3
Todo 📝: 0
Duration 🕐: 86979.847ms
|
Test with Node.js 21 compiled --without-intl
Total Tests: 739
Suites 📂: 50
Passed ✅: 653
Failed ❌: 78
Canceled 🚫: 5
Skipped ⏭️: 3
Todo 📝: 0
Duration 🕐: 81377.670ms
|
Test with Node.js 20 compiled --without-intl
Total Tests: 739
Suites 📂: 50
Passed ✅: 653
Failed ❌: 78
Canceled 🚫: 5
Skipped ⏭️: 3
Todo 📝: 0
Duration 🕐: 81867.551ms
|
test (21, macos-latest) / Test with Node.js 21 on macos-latest
Total Tests: 739
Suites 📂: 50
Passed ✅: 653
Failed ❌: 78
Canceled 🚫: 5
Skipped ⏭️: 3
Todo 📝: 0
Duration 🕐: 149887.216ms
|
test (20, macos-latest) / Test with Node.js 20 on macos-latest
Total Tests: 739
Suites 📂: 50
Passed ✅: 653
Failed ❌: 78
Canceled 🚫: 5
Skipped ⏭️: 3
Todo 📝: 0
Duration 🕐: 150632.399ms
|