diff --git a/test/defaults.test.ts b/test/defaults.test.ts index 8b7d2feae..1130db90c 100644 --- a/test/defaults.test.ts +++ b/test/defaults.test.ts @@ -48,8 +48,7 @@ describe("endpoint.defaults()", () => { [], { headers: { - accept: - "application/vnd.github.foo-preview.raw+json,application/vnd.github.bar-preview.raw+json", + accept: "application/vnd.github.v3.raw+json", authorization: "token 0000000000000000000000000000000000000001", "user-agent": "myApp/1.2.3", }, @@ -63,7 +62,6 @@ describe("endpoint.defaults()", () => { }, mediaType: { format: "raw+json", - previews: ["foo", "bar"], }, org: "my-project", request: { diff --git a/test/request.test.ts b/test/request.test.ts index 2f91a9021..12c3119fd 100644 --- a/test/request.test.ts +++ b/test/request.test.ts @@ -118,7 +118,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w== { id: 123 }, { headers: { - accept: "application/vnd.github.machine-man-preview+json", + accept: "application/vnd.github.v3+json", "user-agent": userAgent, authorization: `bearer ${BEARER}`, }, @@ -129,7 +129,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w== { id: 456 }, { headers: { - accept: "application/vnd.github.machine-man-preview+json", + accept: "application/vnd.github.v3+json", "user-agent": userAgent, authorization: `token secret123`, }, @@ -141,9 +141,6 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w== installationId: 123, }); const requestWithAuth = request.defaults({ - mediaType: { - previews: ["machine-man"], - }, request: { fetch: mock, hook: auth.hook, @@ -625,7 +622,6 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w== }, mediaType: { format: "", - previews: [], }, method: "GET", request: { @@ -687,7 +683,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w== it("options.mediaType.previews", function () { const mock = fetchMock .sandbox() - .mock("https://api.github.com/repos/octokit/request.js/issues/1", "ok", { + .mock("https://api.github.com/graphql", "ok", { headers: { accept: "application/vnd.github.foo-preview+json,application/vnd.github.bar-preview+json", @@ -696,16 +692,13 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w== }, }); - return request("GET /repos/{owner}/{repo}/issues/{number}", { + return request("GET /graphql", { headers: { authorization: "token 0000000000000000000000000000000000000001", }, mediaType: { previews: ["foo", "bar"], }, - owner: "octokit", - repo: "request.js", - number: 1, request: { fetch: mock, }, @@ -732,7 +725,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w== { method: "PUT", headers: { - accept: "application/vnd.github.luke-cage-preview+json", + accept: "application/vnd.github.v3+json", authorization: "token secret123", }, } @@ -740,7 +733,6 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w== return request("PUT /repos/{owner}/{repo}/branches/{branch}/protection", { baseUrl: "https://request-errors-test.com", - mediaType: { previews: ["luke-cage"] }, headers: { authorization: "token secret123", },