Skip to content

chore(deps): update dependency fetch-mock to v12 #288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 23 additions & 16 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@types/node": "^22.0.0",
"@vitest/coverage-v8": "^3.0.0",
"esbuild": "^0.25.0",
"fetch-mock": "^11.0.0",
"fetch-mock": "^12.0.0",
"glob": "^11.0.0",
"prettier": "3.4.2",
"semantic-release-plugin-update-version-in-files": "^1.1.0",
Expand Down
8 changes: 4 additions & 4 deletions test/check-token.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { checkToken } from "../src/index.js";

describe("checkToken()", () => {
it("README example", async () => {
const mock = fetchMock.sandbox().postOnce(
const mock = fetchMock.createInstance().postOnce(
"https://api.github.com/applications/1234567890abcdef1234/token",
{
scopes: ["repo"],
Expand Down Expand Up @@ -34,7 +34,7 @@ describe("checkToken()", () => {
"user-agent": "test",
},
request: {
fetch: mock,
fetch: mock.fetchHandler,
},
}),
});
Expand All @@ -60,7 +60,7 @@ describe("checkToken()", () => {
});

it("GitHub Example", async () => {
const mock = fetchMock.sandbox().postOnce(
const mock = fetchMock.createInstance().postOnce(
"https://api.github.com/applications/lv1.1234567890abcdef/token",
{
expires_at: "2021-10-06T17:26:27Z",
Expand Down Expand Up @@ -90,7 +90,7 @@ describe("checkToken()", () => {
"user-agent": "test",
},
request: {
fetch: mock,
fetch: mock.fetchHandler,
},
}),
});
Expand Down
8 changes: 4 additions & 4 deletions test/create-device-code.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { createDeviceCode } from "../src/index.js";

describe("createDeviceCode()", () => {
it("README example", async () => {
const mock = fetchMock.sandbox().postOnce(
const mock = fetchMock.createInstance().postOnce(
"https://github.com/login/device/code",
{
device_code: "devicecode123",
Expand Down Expand Up @@ -36,7 +36,7 @@ describe("createDeviceCode()", () => {
"user-agent": "test",
},
request: {
fetch: mock,
fetch: mock.fetchHandler,
},
}),
});
Expand All @@ -53,7 +53,7 @@ describe("createDeviceCode()", () => {
});

it("GitHub App example", async () => {
const mock = fetchMock.sandbox().postOnce(
const mock = fetchMock.createInstance().postOnce(
"https://github.com/login/device/code",
{
device_code: "devicecode123",
Expand Down Expand Up @@ -82,7 +82,7 @@ describe("createDeviceCode()", () => {
"user-agent": "test",
},
request: {
fetch: mock,
fetch: mock.fetchHandler,
},
}),
});
Expand Down
8 changes: 4 additions & 4 deletions test/delete-authorization.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

describe("deleteAuthorization()", () => {
it("README example", async () => {
const mock = fetchMock.sandbox().deleteOnce(
const mock = fetchMock.createInstance().deleteOnce(
"https://api.github.com/applications/1234567890abcdef1234/grant",
{
status: 204,
Expand All @@ -24,7 +24,7 @@
},
);

const response = await deleteAuthorization({

Check failure on line 27 in test/delete-authorization.test.ts

View workflow job for this annotation

GitHub Actions / test_matrix (18)

test/delete-authorization.test.ts > deleteAuthorization() > README example

HttpError: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/1234567890abcdef1234/grant ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:76:26 ❯ test/delete-authorization.test.ts:27:22 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 500, request: { method: 'DELETE', url: 'https://api.github.com/applications/1234567890abcdef1234/grant', headers: { accept: 'application/vnd.github.v3+json', 'user-agent': 'test', authorization: 'basic [REDACTED]', 'content-type': 'application/json; charset=utf-8' }, body: { access_token: 'token123' }, request: { fetch: 'Function<bound fetchHandler>' } }, response: undefined } Caused by: Caused by: Error: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/1234567890abcdef1234/grant ❯ node_modules/fetch-mock/dist/esm/Router.js:119:24 ❯ Router.execute node_modules/fetch-mock/dist/esm/Router.js:80:16 ❯ FetchMock.fetchHandler node_modules/fetch-mock/dist/esm/FetchMock.js:63:45 ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:50:27 ❯ newApi node_modules/@octokit/request/dist-bundle/index.js:173:14 ❯ deleteAuthorization src/delete-authorization.ts:38:10 ❯ test/delete-authorization.test.ts:27:28

Check failure on line 27 in test/delete-authorization.test.ts

View workflow job for this annotation

GitHub Actions / test_matrix (20)

test/delete-authorization.test.ts > deleteAuthorization() > README example

HttpError: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/1234567890abcdef1234/grant ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:76:26 ❯ test/delete-authorization.test.ts:27:22 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 500, request: { method: 'DELETE', url: 'https://api.github.com/applications/1234567890abcdef1234/grant', headers: { accept: 'application/vnd.github.v3+json', 'user-agent': 'test', authorization: 'basic [REDACTED]', 'content-type': 'application/json; charset=utf-8' }, body: { access_token: 'token123' }, request: { fetch: 'Function<bound fetchHandler>' } }, response: undefined } Caused by: Caused by: Error: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/1234567890abcdef1234/grant ❯ node_modules/fetch-mock/dist/esm/Router.js:119:24 ❯ Router.execute node_modules/fetch-mock/dist/esm/Router.js:80:16 ❯ FetchMock.fetchHandler node_modules/fetch-mock/dist/esm/FetchMock.js:63:45 ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:50:27 ❯ newApi node_modules/@octokit/request/dist-bundle/index.js:173:14 ❯ deleteAuthorization src/delete-authorization.ts:38:10 ❯ test/delete-authorization.test.ts:27:28

Check failure on line 27 in test/delete-authorization.test.ts

View workflow job for this annotation

GitHub Actions / test_matrix (22)

test/delete-authorization.test.ts > deleteAuthorization() > README example

HttpError: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/1234567890abcdef1234/grant ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:76:26 ❯ test/delete-authorization.test.ts:27:22 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 500, request: { method: 'DELETE', url: 'https://api.github.com/applications/1234567890abcdef1234/grant', headers: { accept: 'application/vnd.github.v3+json', 'user-agent': 'test', authorization: 'basic [REDACTED]', 'content-type': 'application/json; charset=utf-8' }, body: { access_token: 'token123' }, request: { fetch: 'Function<bound fetchHandler>' } }, response: undefined } Caused by: Caused by: Error: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/1234567890abcdef1234/grant ❯ node_modules/fetch-mock/dist/esm/Router.js:119:24 ❯ Router.execute node_modules/fetch-mock/dist/esm/Router.js:80:16 ❯ FetchMock.fetchHandler node_modules/fetch-mock/dist/esm/FetchMock.js:63:45 ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:50:27 ❯ newApi node_modules/@octokit/request/dist-bundle/index.js:173:14 ❯ deleteAuthorization src/delete-authorization.ts:38:10 ❯ test/delete-authorization.test.ts:27:28
clientType: "oauth-app",
clientId: "1234567890abcdef1234",
clientSecret: "1234567890abcdef12347890abcdef12345678",
Expand All @@ -34,7 +34,7 @@
"user-agent": "test",
},
request: {
fetch: mock,
fetch: mock.fetchHandler,
},
}),
});
Expand All @@ -50,7 +50,7 @@
});

it("GitHub App", async () => {
const mock = fetchMock.sandbox().deleteOnce(
const mock = fetchMock.createInstance().deleteOnce(
"https://api.github.com/applications/lv1.1234567890abcdef/grant",
{
scopes: [],
Expand All @@ -70,7 +70,7 @@
},
);

const response = await deleteAuthorization({

Check failure on line 73 in test/delete-authorization.test.ts

View workflow job for this annotation

GitHub Actions / test_matrix (18)

test/delete-authorization.test.ts > deleteAuthorization() > GitHub App

HttpError: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/lv1.1234567890abcdef/grant ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:76:26 ❯ test/delete-authorization.test.ts:73:22 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 500, request: { method: 'DELETE', url: 'https://api.github.com/applications/lv1.1234567890abcdef/grant', headers: { accept: 'application/vnd.github.v3+json', 'user-agent': 'test', authorization: 'basic [REDACTED]', 'content-type': 'application/json; charset=utf-8' }, body: { access_token: 'token123' }, request: { fetch: 'Function<bound fetchHandler>' } }, response: undefined } Caused by: Caused by: Error: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/lv1.1234567890abcdef/grant ❯ node_modules/fetch-mock/dist/esm/Router.js:119:24 ❯ Router.execute node_modules/fetch-mock/dist/esm/Router.js:80:16 ❯ FetchMock.fetchHandler node_modules/fetch-mock/dist/esm/FetchMock.js:63:45 ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:50:27 ❯ newApi node_modules/@octokit/request/dist-bundle/index.js:173:14 ❯ deleteAuthorization src/delete-authorization.ts:38:10 ❯ test/delete-authorization.test.ts:73:28

Check failure on line 73 in test/delete-authorization.test.ts

View workflow job for this annotation

GitHub Actions / test_matrix (20)

test/delete-authorization.test.ts > deleteAuthorization() > GitHub App

HttpError: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/lv1.1234567890abcdef/grant ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:76:26 ❯ test/delete-authorization.test.ts:73:22 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 500, request: { method: 'DELETE', url: 'https://api.github.com/applications/lv1.1234567890abcdef/grant', headers: { accept: 'application/vnd.github.v3+json', 'user-agent': 'test', authorization: 'basic [REDACTED]', 'content-type': 'application/json; charset=utf-8' }, body: { access_token: 'token123' }, request: { fetch: 'Function<bound fetchHandler>' } }, response: undefined } Caused by: Caused by: Error: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/lv1.1234567890abcdef/grant ❯ node_modules/fetch-mock/dist/esm/Router.js:119:24 ❯ Router.execute node_modules/fetch-mock/dist/esm/Router.js:80:16 ❯ FetchMock.fetchHandler node_modules/fetch-mock/dist/esm/FetchMock.js:63:45 ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:50:27 ❯ newApi node_modules/@octokit/request/dist-bundle/index.js:173:14 ❯ deleteAuthorization src/delete-authorization.ts:38:10 ❯ test/delete-authorization.test.ts:73:28

Check failure on line 73 in test/delete-authorization.test.ts

View workflow job for this annotation

GitHub Actions / test_matrix (22)

test/delete-authorization.test.ts > deleteAuthorization() > GitHub App

HttpError: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/lv1.1234567890abcdef/grant ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:76:26 ❯ test/delete-authorization.test.ts:73:22 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 500, request: { method: 'DELETE', url: 'https://api.github.com/applications/lv1.1234567890abcdef/grant', headers: { accept: 'application/vnd.github.v3+json', 'user-agent': 'test', authorization: 'basic [REDACTED]', 'content-type': 'application/json; charset=utf-8' }, body: { access_token: 'token123' }, request: { fetch: 'Function<bound fetchHandler>' } }, response: undefined } Caused by: Caused by: Error: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/lv1.1234567890abcdef/grant ❯ node_modules/fetch-mock/dist/esm/Router.js:119:24 ❯ Router.execute node_modules/fetch-mock/dist/esm/Router.js:80:16 ❯ FetchMock.fetchHandler node_modules/fetch-mock/dist/esm/FetchMock.js:63:45 ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:50:27 ❯ newApi node_modules/@octokit/request/dist-bundle/index.js:173:14 ❯ deleteAuthorization src/delete-authorization.ts:38:10 ❯ test/delete-authorization.test.ts:73:28
clientType: "github-app",
clientId: "lv1.1234567890abcdef",
clientSecret: "1234567890abcdef12347890abcdef12345678",
Expand All @@ -80,7 +80,7 @@
"user-agent": "test",
},
request: {
fetch: mock,
fetch: mock.fetchHandler,
},
}),
});
Expand Down
8 changes: 4 additions & 4 deletions test/delete-token.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

describe("deleteToken()", () => {
it("README example", async () => {
const mock = fetchMock.sandbox().deleteOnce(
const mock = fetchMock.createInstance().deleteOnce(
"https://api.github.com/applications/1234567890abcdef1234/token",
{
status: 204,
Expand All @@ -24,7 +24,7 @@
},
);

const response = await deleteToken({

Check failure on line 27 in test/delete-token.test.ts

View workflow job for this annotation

GitHub Actions / test_matrix (18)

test/delete-token.test.ts > deleteToken() > README example

HttpError: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/1234567890abcdef1234/token ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:76:26 ❯ test/delete-token.test.ts:27:22 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 500, request: { method: 'DELETE', url: 'https://api.github.com/applications/1234567890abcdef1234/token', headers: { accept: 'application/vnd.github.v3+json', 'user-agent': 'test', authorization: 'basic [REDACTED]', 'content-type': 'application/json; charset=utf-8' }, body: { access_token: 'token123' }, request: { fetch: 'Function<bound fetchHandler>' } }, response: undefined } Caused by: Caused by: Error: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/1234567890abcdef1234/token ❯ node_modules/fetch-mock/dist/esm/Router.js:119:24 ❯ Router.execute node_modules/fetch-mock/dist/esm/Router.js:80:16 ❯ FetchMock.fetchHandler node_modules/fetch-mock/dist/esm/FetchMock.js:63:45 ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:50:27 ❯ newApi node_modules/@octokit/request/dist-bundle/index.js:173:14 ❯ deleteToken src/delete-token.ts:37:10 ❯ test/delete-token.test.ts:27:28

Check failure on line 27 in test/delete-token.test.ts

View workflow job for this annotation

GitHub Actions / test_matrix (20)

test/delete-token.test.ts > deleteToken() > README example

HttpError: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/1234567890abcdef1234/token ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:76:26 ❯ test/delete-token.test.ts:27:22 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 500, request: { method: 'DELETE', url: 'https://api.github.com/applications/1234567890abcdef1234/token', headers: { accept: 'application/vnd.github.v3+json', 'user-agent': 'test', authorization: 'basic [REDACTED]', 'content-type': 'application/json; charset=utf-8' }, body: { access_token: 'token123' }, request: { fetch: 'Function<bound fetchHandler>' } }, response: undefined } Caused by: Caused by: Error: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/1234567890abcdef1234/token ❯ node_modules/fetch-mock/dist/esm/Router.js:119:24 ❯ Router.execute node_modules/fetch-mock/dist/esm/Router.js:80:16 ❯ FetchMock.fetchHandler node_modules/fetch-mock/dist/esm/FetchMock.js:63:45 ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:50:27 ❯ newApi node_modules/@octokit/request/dist-bundle/index.js:173:14 ❯ deleteToken src/delete-token.ts:37:10 ❯ test/delete-token.test.ts:27:28

Check failure on line 27 in test/delete-token.test.ts

View workflow job for this annotation

GitHub Actions / test_matrix (22)

test/delete-token.test.ts > deleteToken() > README example

HttpError: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/1234567890abcdef1234/token ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:76:26 ❯ test/delete-token.test.ts:27:22 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 500, request: { method: 'DELETE', url: 'https://api.github.com/applications/1234567890abcdef1234/token', headers: { accept: 'application/vnd.github.v3+json', 'user-agent': 'test', authorization: 'basic [REDACTED]', 'content-type': 'application/json; charset=utf-8' }, body: { access_token: 'token123' }, request: { fetch: 'Function<bound fetchHandler>' } }, response: undefined } Caused by: Caused by: Error: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/1234567890abcdef1234/token ❯ node_modules/fetch-mock/dist/esm/Router.js:119:24 ❯ Router.execute node_modules/fetch-mock/dist/esm/Router.js:80:16 ❯ FetchMock.fetchHandler node_modules/fetch-mock/dist/esm/FetchMock.js:63:45 ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:50:27 ❯ newApi node_modules/@octokit/request/dist-bundle/index.js:173:14 ❯ deleteToken src/delete-token.ts:37:10 ❯ test/delete-token.test.ts:27:28
clientType: "oauth-app",
clientId: "1234567890abcdef1234",
clientSecret: "1234567890abcdef12347890abcdef12345678",
Expand All @@ -34,7 +34,7 @@
"user-agent": "test",
},
request: {
fetch: mock,
fetch: mock.fetchHandler,
},
}),
});
Expand All @@ -50,7 +50,7 @@
});

it("GitHub App", async () => {
const mock = fetchMock.sandbox().deleteOnce(
const mock = fetchMock.createInstance().deleteOnce(
"https://api.github.com/applications/lv1.1234567890abcdef/token",
{
scopes: [],
Expand All @@ -70,7 +70,7 @@
},
);

const response = await deleteToken({

Check failure on line 73 in test/delete-token.test.ts

View workflow job for this annotation

GitHub Actions / test_matrix (18)

test/delete-token.test.ts > deleteToken() > GitHub App

HttpError: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/lv1.1234567890abcdef/token ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:76:26 ❯ test/delete-token.test.ts:73:22 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 500, request: { method: 'DELETE', url: 'https://api.github.com/applications/lv1.1234567890abcdef/token', headers: { accept: 'application/vnd.github.v3+json', 'user-agent': 'test', authorization: 'basic [REDACTED]', 'content-type': 'application/json; charset=utf-8' }, body: { access_token: 'token123' }, request: { fetch: 'Function<bound fetchHandler>' } }, response: undefined } Caused by: Caused by: Error: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/lv1.1234567890abcdef/token ❯ node_modules/fetch-mock/dist/esm/Router.js:119:24 ❯ Router.execute node_modules/fetch-mock/dist/esm/Router.js:80:16 ❯ FetchMock.fetchHandler node_modules/fetch-mock/dist/esm/FetchMock.js:63:45 ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:50:27 ❯ newApi node_modules/@octokit/request/dist-bundle/index.js:173:14 ❯ deleteToken src/delete-token.ts:37:10 ❯ test/delete-token.test.ts:73:28

Check failure on line 73 in test/delete-token.test.ts

View workflow job for this annotation

GitHub Actions / test_matrix (20)

test/delete-token.test.ts > deleteToken() > GitHub App

HttpError: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/lv1.1234567890abcdef/token ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:76:26 ❯ test/delete-token.test.ts:73:22 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 500, request: { method: 'DELETE', url: 'https://api.github.com/applications/lv1.1234567890abcdef/token', headers: { accept: 'application/vnd.github.v3+json', 'user-agent': 'test', authorization: 'basic [REDACTED]', 'content-type': 'application/json; charset=utf-8' }, body: { access_token: 'token123' }, request: { fetch: 'Function<bound fetchHandler>' } }, response: undefined } Caused by: Caused by: Error: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/lv1.1234567890abcdef/token ❯ node_modules/fetch-mock/dist/esm/Router.js:119:24 ❯ Router.execute node_modules/fetch-mock/dist/esm/Router.js:80:16 ❯ FetchMock.fetchHandler node_modules/fetch-mock/dist/esm/FetchMock.js:63:45 ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:50:27 ❯ newApi node_modules/@octokit/request/dist-bundle/index.js:173:14 ❯ deleteToken src/delete-token.ts:37:10 ❯ test/delete-token.test.ts:73:28

Check failure on line 73 in test/delete-token.test.ts

View workflow job for this annotation

GitHub Actions / test_matrix (22)

test/delete-token.test.ts > deleteToken() > GitHub App

HttpError: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/lv1.1234567890abcdef/token ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:76:26 ❯ test/delete-token.test.ts:73:22 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 500, request: { method: 'DELETE', url: 'https://api.github.com/applications/lv1.1234567890abcdef/token', headers: { accept: 'application/vnd.github.v3+json', 'user-agent': 'test', authorization: 'basic [REDACTED]', 'content-type': 'application/json; charset=utf-8' }, body: { access_token: 'token123' }, request: { fetch: 'Function<bound fetchHandler>' } }, response: undefined } Caused by: Caused by: Error: fetch-mock: No response or fallback rule to cover delete to https://api.github.com/applications/lv1.1234567890abcdef/token ❯ node_modules/fetch-mock/dist/esm/Router.js:119:24 ❯ Router.execute node_modules/fetch-mock/dist/esm/Router.js:80:16 ❯ FetchMock.fetchHandler node_modules/fetch-mock/dist/esm/FetchMock.js:63:45 ❯ fetchWrapper node_modules/@octokit/request/dist-bundle/index.js:50:27 ❯ newApi node_modules/@octokit/request/dist-bundle/index.js:173:14 ❯ deleteToken src/delete-token.ts:37:10 ❯ test/delete-token.test.ts:73:28
clientType: "github-app",
clientId: "lv1.1234567890abcdef",
clientSecret: "1234567890abcdef12347890abcdef12345678",
Expand All @@ -80,7 +80,7 @@
"user-agent": "test",
},
request: {
fetch: mock,
fetch: mock.fetchHandler,
},
}),
});
Expand Down
28 changes: 14 additions & 14 deletions test/exchange-device-code.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { exchangeDeviceCode } from "../src/index.js";

describe("exchangeDeviceCode()", () => {
it("README example", async () => {
const mock = fetchMock.sandbox().postOnce(
const mock = fetchMock.createInstance().postOnce(
"https://github.com/login/oauth/access_token",
{
access_token: "secret123",
Expand Down Expand Up @@ -35,7 +35,7 @@ describe("exchangeDeviceCode()", () => {
"user-agent": "test",
},
request: {
fetch: mock,
fetch: mock.fetchHandler,
},
}),
});
Expand All @@ -58,7 +58,7 @@ describe("exchangeDeviceCode()", () => {
});

it("with scopes", async () => {
const mock = fetchMock.sandbox().postOnce(
const mock = fetchMock.createInstance().postOnce(
"https://github.com/login/oauth/access_token",
{
access_token: "secret123",
Expand Down Expand Up @@ -89,7 +89,7 @@ describe("exchangeDeviceCode()", () => {
"user-agent": "test",
},
request: {
fetch: mock,
fetch: mock.fetchHandler,
},
}),
});
Expand All @@ -115,7 +115,7 @@ describe("exchangeDeviceCode()", () => {
});

it("authorization_pending error", async () => {
const mock = fetchMock.sandbox().postOnce(
const mock = fetchMock.createInstance().postOnce(
"https://github.com/login/oauth/access_token",
{
error: "authorization_pending",
Expand Down Expand Up @@ -147,7 +147,7 @@ describe("exchangeDeviceCode()", () => {
"user-agent": "test",
},
request: {
fetch: mock,
fetch: mock.fetchHandler,
},
}),
}),
Expand All @@ -157,7 +157,7 @@ describe("exchangeDeviceCode()", () => {
});

it("OAuth App with ClientSecret", async () => {
const mock = fetchMock.sandbox().postOnce(
const mock = fetchMock.createInstance().postOnce(
"https://github.com/login/oauth/access_token",
{
access_token: "secret123",
Expand Down Expand Up @@ -188,7 +188,7 @@ describe("exchangeDeviceCode()", () => {
"user-agent": "test",
},
request: {
fetch: mock,
fetch: mock.fetchHandler,
},
}),
});
Expand All @@ -212,7 +212,7 @@ describe("exchangeDeviceCode()", () => {
});

it("GitHub App", async () => {
const mock = fetchMock.sandbox().postOnce(
const mock = fetchMock.createInstance().postOnce(
"https://github.com/login/oauth/access_token",
{
access_token: "secret123",
Expand Down Expand Up @@ -242,7 +242,7 @@ describe("exchangeDeviceCode()", () => {
"user-agent": "test",
},
request: {
fetch: mock,
fetch: mock.fetchHandler,
},
}),
});
Expand All @@ -264,7 +264,7 @@ describe("exchangeDeviceCode()", () => {
});

it("GitHub App with clientSecret", async () => {
const mock = fetchMock.sandbox().postOnce(
const mock = fetchMock.createInstance().postOnce(
"https://github.com/login/oauth/access_token",
{
access_token: "secret123",
Expand Down Expand Up @@ -295,7 +295,7 @@ describe("exchangeDeviceCode()", () => {
"user-agent": "test",
},
request: {
fetch: mock,
fetch: mock.fetchHandler,
},
}),
});
Expand All @@ -318,7 +318,7 @@ describe("exchangeDeviceCode()", () => {
});

it("Refresh token", async () => {
const mock = fetchMock.sandbox().postOnce(
const mock = fetchMock.createInstance().postOnce(
"https://github.com/login/oauth/access_token",
{
body: {
Expand Down Expand Up @@ -356,7 +356,7 @@ describe("exchangeDeviceCode()", () => {
"user-agent": "test",
},
request: {
fetch: mock,
fetch: mock.fetchHandler,
},
}),
});
Expand Down
Loading
Loading