Skip to content

Commit

Permalink
test: try buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
merceyz committed Feb 4, 2024
1 parent 0643456 commit d3e6ca6
Show file tree
Hide file tree
Showing 51 changed files with 42 additions and 22 deletions.
Binary file modified tests/nock/0mijz-lZ_5pF8f6tlAdbKg-1.dat
Binary file not shown.
3 changes: 2 additions & 1 deletion tests/nock/2Vuch5EnmzPEVel1DWYfPQ-1.dat

Large diffs are not rendered by default.

Binary file modified tests/nock/2bh2z3MgoMIcnxHAMev5uQ-1.dat
Binary file not shown.
Binary file modified tests/nock/2ituqIIXsQUU5l2SZSMRDQ-1.dat
Binary file not shown.
Binary file modified tests/nock/3cCMRJMrFyNpV7MlFGUXYw-1.dat
Binary file not shown.
Binary file modified tests/nock/4IfgwoxNR5JV5bBojS26Kg-1.dat
Binary file not shown.
Binary file modified tests/nock/4IfgwoxNR5JV5bBojS26Kg-2.dat
Binary file not shown.
Binary file modified tests/nock/4IfgwoxNR5JV5bBojS26Kg-3.dat
Binary file not shown.
3 changes: 2 additions & 1 deletion tests/nock/6BSdMkNfyZxTnw4r9rK5ig-1.dat

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion tests/nock/6zkNeK1b_EJchZZ1iQz7GQ-1.dat

Large diffs are not rendered by default.

Binary file modified tests/nock/7_ZKSRHG7OfkRvPJHYpxbQ-1.dat
Binary file not shown.
Binary file modified tests/nock/8LXMft4IyEWeaqoiynS5FA-1.dat
Binary file not shown.
4 changes: 3 additions & 1 deletion tests/nock/AL__3okpCdfjA6kGuG2rFQ-1.dat

Large diffs are not rendered by default.

Binary file modified tests/nock/ClrKWNyvjynLF4vcKkUjqQ-1.dat
Binary file not shown.
Binary file modified tests/nock/D4fdrCUUCl7i1D6eeg49zQ-1.dat
Binary file not shown.
Binary file modified tests/nock/GSh7RCQN4e8flEL6h2lnwQ-1.dat
Binary file not shown.
Binary file modified tests/nock/K26guRbYG9vZYQwgFU5lHg-1.dat
Binary file not shown.
Binary file modified tests/nock/LU_vfrNkPzIhLrr405IpzQ-1.dat
Binary file not shown.
Binary file modified tests/nock/M82EVNBXM8yFkn6tOCflMA-1.dat
Binary file not shown.
Binary file modified tests/nock/MVR-DPxEL7jQE9aetA791Q-1.dat
Binary file not shown.
3 changes: 2 additions & 1 deletion tests/nock/MuEAzZXT77khPx8FpLSF2A-1.dat

Large diffs are not rendered by default.

Binary file modified tests/nock/S9h20CvrT1ljP2zwMQUMFw-1.dat
Binary file not shown.
3 changes: 2 additions & 1 deletion tests/nock/TnyRFo6IK894n_HQkACElA-1.dat

Large diffs are not rendered by default.

Binary file modified tests/nock/Vp5BnbFIGGY7ZeZMncmwMw-1.dat
Binary file not shown.
3 changes: 2 additions & 1 deletion tests/nock/VtMTrMazyfrMmIBBLfdGzA-1.dat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified tests/nock/VurwVdvlR5Rs7xQVs9UCVw-1.dat
Binary file not shown.
Binary file modified tests/nock/WAsCdU-KCdvkg9dJ46zkWQ-1.dat
Binary file not shown.
Binary file modified tests/nock/WyEcK5FmdvhvOqnb2mHi5A-1.dat
Binary file not shown.
3 changes: 2 additions & 1 deletion tests/nock/WyEcK5FmdvhvOqnb2mHi5A-3.dat

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion tests/nock/XtnC4qVqg7VJUOAoKyxAbA-1.dat

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion tests/nock/XtnC4qVqg7VJUOAoKyxAbA-2.dat

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion tests/nock/XtnC4qVqg7VJUOAoKyxAbA-3.dat

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion tests/nock/_2yNDOq6UlHEKY9lwBEOig-1.dat

Large diffs are not rendered by default.

Binary file modified tests/nock/_ssVB5fpNumqL8RMl4TqHw-1.dat
Binary file not shown.
3 changes: 2 additions & 1 deletion tests/nock/_ssVB5fpNumqL8RMl4TqHw-3.dat

Large diffs are not rendered by default.

Binary file modified tests/nock/bNE0FYc3WlnFGzjHaIdf5A-1.dat
Binary file not shown.
3 changes: 2 additions & 1 deletion tests/nock/cRq-o3WTbH0_0MVIM498_Q-1.dat

Large diffs are not rendered by default.

Binary file modified tests/nock/fskWDnBnd-E_LlkU7xvjwQ-1.dat
Binary file not shown.
6 changes: 4 additions & 2 deletions tests/nock/gD354-khxZHN8IJPre6iqw-1.dat

Large diffs are not rendered by default.

Binary file modified tests/nock/h9H6jL9ro_imv61YP24nGg-2.dat
Binary file not shown.
Binary file modified tests/nock/h9H6jL9ro_imv61YP24nGg-3.dat
Binary file not shown.
3 changes: 2 additions & 1 deletion tests/nock/lU3UuMuorez9QziSUhGg8g-1.dat

Large diffs are not rendered by default.

Binary file modified tests/nock/oza0_71_8jb3typs-3gduw-1.dat
Binary file not shown.
Binary file modified tests/nock/pBMzygfekzLgFHBxfUwMyg-1.dat
Binary file not shown.
Binary file modified tests/nock/sogVBiC-f6IO6vTAaPDx5w-1.dat
Binary file not shown.
Binary file modified tests/nock/vA1ZjUdN7-YPy8p6BF8_RQ-1.dat
Binary file not shown.
Binary file modified tests/nock/ypWhs6_VxInVlmWLHRm3FA-1.dat
Binary file not shown.
Binary file modified tests/nock/ypWhs6_VxInVlmWLHRm3FA-2.dat
Binary file not shown.
3 changes: 2 additions & 1 deletion tests/nock/zIqNSOkKydlbZyC4vpFlug-1.dat

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion tests/nock/zvUek_ksfEFwWRnAJUuOFw-1.dat

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions tests/recordRequests.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const path = require(`node:path`);
const v8 = require(`node:v8`);

/**
* @type {Map<string, {body: Uint8Array, status:number, headers: Record<string,string>}>}
* @type {Map<string, {body: Buffer, status:number, headers: Record<string,string>}>}
*/
let mocks = new Map();

Expand Down Expand Up @@ -32,7 +32,7 @@ if (process.env.NOCK_ENV === `record`) {

mocks ??= new Map();
mocks.set(input.toString(), {
body: new Uint8Array(data).slice(),
body: Buffer.from(new Uint8Array(data)),
status: response.status,
headers: Object.fromEntries(minimalHeaders),
});
Expand Down Expand Up @@ -66,7 +66,7 @@ if (process.env.NOCK_ENV === `record`) {
const mock = mocks.get(input.toString());
if (!mock) throw new Error(`No mock found for ${input}`);

return new Response(mock.body.slice(), {
return new Response(Buffer.from(mock.body), {
status: mock.status,
headers: mock.headers,
});
Expand Down

0 comments on commit d3e6ca6

Please sign in to comment.