feat(api): add User-Agent header to raw apiFetch calls #1776
ci.yml
on: pull_request
🧹 Lint Check
1m 1s
🔍 Type Check
23s
Matrix: 🧪 Test Matrix
Annotations
32 errors and 1 warning
|
🧪 Test Matrix (22, ubuntu-latest)
Process completed with exit code 1.
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should preserve Authorization header on same-origin redirects:
src/utils/api.test.mts#L612
AssertionError: expected undefined to be '***' // Object.is equality
- Expected:
"***"
+ Received:
undefined
❯ src/utils/api.test.mts:612:48
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should follow redirects in https.request path:
src/utils/api.test.mts#L470
AssertionError: expected "spy" to be called 2 times, but got 0 times
❯ src/utils/api.test.mts:470:30
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should set Content-Length header for POST requests through https.request:
src/utils/api.test.mts#L410
TypeError: Cannot read properties of undefined (reading '1')
❯ src/utils/api.test.mts:410:28
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should handle multi-value response headers from https.request:
src/utils/api.test.mts#L367
AssertionError: expected false to be true // Object.is equality
- Expected
+ Received
- true
+ false
❯ src/utils/api.test.mts:367:23
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should pass request body for POST requests through https.request:
src/utils/api.test.mts#L325
AssertionError: expected "spy" to be called with arguments: [ '{"key":"value"}' ]
Number of calls: 0
❯ src/utils/api.test.mts:325:27
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should handle https.request errors gracefully:
src/utils/api.test.mts#L282
AssertionError: expected 'Error: [vitest] No "getCliUserAgent" …' to contain 'unable to get local issuer certificate'
- Expected
+ Received
- unable to get local issuer certificate
+ Error: [vitest] No "getCliUserAgent" export is defined on the "./sdk.mts" mock. Did you forget to return it from "vi.mock"?
+ If you need to partially mock a module, you can use "importOriginal" helper inside: (path: test/path)
❯ src/utils/api.test.mts:282:28
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should construct valid Response from https.request output:
src/utils/api.test.mts#L247
AssertionError: expected false to be true // Object.is equality
- Expected
+ Received
- true
+ false
❯ src/utils/api.test.mts:247:23
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should use https.request when extra CA certs are available:
src/utils/api.test.mts#L198
AssertionError: expected "spy" to be called at least once
❯ src/utils/api.test.mts:198:30
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should use https.request with no agent when no extra CA certs are needed:
src/utils/api.test.mts#L150
AssertionError: expected "spy" to be called at least once
❯ src/utils/api.test.mts:150:30
|
|
🧪 Test Matrix (24, ubuntu-latest)
The strategy configuration was canceled because "test._22_ubuntu-latest" failed
|
|
🧪 Test Matrix (24, ubuntu-latest)
The operation was canceled.
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should preserve Authorization header on same-origin redirects:
src/utils/api.test.mts#L612
AssertionError: expected undefined to be '***' // Object.is equality
- Expected:
"***"
+ Received:
undefined
❯ src/utils/api.test.mts:612:48
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should follow redirects in https.request path:
src/utils/api.test.mts#L470
AssertionError: expected "spy" to be called 2 times, but got 0 times
❯ src/utils/api.test.mts:470:30
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should set Content-Length header for POST requests through https.request:
src/utils/api.test.mts#L410
TypeError: Cannot read properties of undefined (reading '1')
❯ src/utils/api.test.mts:410:28
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should handle multi-value response headers from https.request:
src/utils/api.test.mts#L367
AssertionError: expected false to be true // Object.is equality
- Expected
+ Received
- true
+ false
❯ src/utils/api.test.mts:367:23
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should pass request body for POST requests through https.request:
src/utils/api.test.mts#L325
AssertionError: expected "spy" to be called with arguments: [ '{"key":"value"}' ]
Number of calls: 0
❯ src/utils/api.test.mts:325:27
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should handle https.request errors gracefully:
src/utils/api.test.mts#L282
AssertionError: expected 'Error: [vitest] No "getCliUserAgent" …' to contain 'unable to get local issuer certificate'
- Expected
+ Received
- unable to get local issuer certificate
+ Error: [vitest] No "getCliUserAgent" export is defined on the "./sdk.mts" mock. Did you forget to return it from "vi.mock"?
+ If you need to partially mock a module, you can use "importOriginal" helper inside: (path: test/path)
❯ src/utils/api.test.mts:282:28
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should construct valid Response from https.request output:
src/utils/api.test.mts#L247
AssertionError: expected false to be true // Object.is equality
- Expected
+ Received
- true
+ false
❯ src/utils/api.test.mts:247:23
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should use https.request when extra CA certs are available:
src/utils/api.test.mts#L198
AssertionError: expected "spy" to be called at least once
❯ src/utils/api.test.mts:198:30
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should use https.request with no agent when no extra CA certs are needed:
src/utils/api.test.mts#L150
AssertionError: expected "spy" to be called at least once
❯ src/utils/api.test.mts:150:30
|
|
🧪 Test Matrix (20, ubuntu-latest)
The strategy configuration was canceled because "test._22_ubuntu-latest" failed
|
|
🧪 Test Matrix (20, ubuntu-latest)
The operation was canceled.
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should preserve Authorization header on same-origin redirects:
src/utils/api.test.mts#L612
AssertionError: expected undefined to be '***' // Object.is equality
- Expected:
"***"
+ Received:
undefined
❯ src/utils/api.test.mts:612:48
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should follow redirects in https.request path:
src/utils/api.test.mts#L470
AssertionError: expected "spy" to be called 2 times, but got 0 times
❯ src/utils/api.test.mts:470:30
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should set Content-Length header for POST requests through https.request:
src/utils/api.test.mts#L410
TypeError: Cannot read properties of undefined (reading '1')
❯ src/utils/api.test.mts:410:28
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should handle multi-value response headers from https.request:
src/utils/api.test.mts#L367
AssertionError: expected false to be true // Object.is equality
- Expected
+ Received
- true
+ false
❯ src/utils/api.test.mts:367:23
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should pass request body for POST requests through https.request:
src/utils/api.test.mts#L325
AssertionError: expected "spy" to be called with arguments: [ '{"key":"value"}' ]
Number of calls: 0
❯ src/utils/api.test.mts:325:27
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should handle https.request errors gracefully:
src/utils/api.test.mts#L282
AssertionError: expected 'Error: [vitest] No "getCliUserAgent" …' to contain 'unable to get local issuer certificate'
- Expected
+ Received
- unable to get local issuer certificate
+ Error: [vitest] No "getCliUserAgent" export is defined on the "./sdk.mts" mock. Did you forget to return it from "vi.mock"?
+ If you need to partially mock a module, you can use "importOriginal" helper inside: (path: test/path)
❯ src/utils/api.test.mts:282:28
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should construct valid Response from https.request output:
src/utils/api.test.mts#L247
AssertionError: expected false to be true // Object.is equality
- Expected
+ Received
- true
+ false
❯ src/utils/api.test.mts:247:23
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should use https.request when extra CA certs are available:
src/utils/api.test.mts#L198
AssertionError: expected "spy" to be called at least once
❯ src/utils/api.test.mts:198:30
|
|
src/utils/api.test.mts > apiFetch with extra CA certificates > should use https.request with no agent when no extra CA certs are needed:
src/utils/api.test.mts#L150
AssertionError: expected "spy" to be called at least once
❯ src/utils/api.test.mts:150:30
|
|
🧹 Lint Check:
src/utils/purl-to-ghsa.mts#L4
`./errors.mts` import should occur before import of `./github.mts`
|