Skip to content

Commit 56f2eea

Browse files
committed
fix
1 parent e2de181 commit 56f2eea

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/get-file-content.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export async function getFileContents(
5656
// @ts-expect-error This type comes from @octokit/openapi-types, not much we can do to fix it
5757
.request(route, getContentsParameters)
5858
.catch((error: RequestError) => {
59-
/* v8 ignore next -- @preserve */
59+
/* v8 ignore if -- @preserve */
6060
if (error.status !== 404) throw error;
6161

6262
return {
@@ -99,10 +99,11 @@ export async function getFileContents(
9999
content: base64ToUtf8(data.content),
100100
sha: data.sha,
101101
};
102-
/* v8 ignore start -- @preserve */
103102
} catch (error: any) {
103+
/* v8 ignore next -- @preserve */
104104
if (error.message !== "URI malformed") throw error;
105105

106+
/* v8 ignore next -- @preserve */
106107
throw new RequestError(
107108
`[@octokit/plugin-create-or-update-text-file] ${requestOptions.url} is a binary file, only text files are supported`,
108109
403,

src/utils.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* v8 ignore start */
21
// universal implementation of nodeUtf8ToBase64/nodeBase64ToUtf8 methods for browsers, Node, and Deno.
32
//
43
// - good docs on base64
@@ -54,5 +53,3 @@ function browserBase64ToUtf8(data: string) {
5453

5554
export const utf8ToBase64 = isNode ? nodeUtf8ToBase64 : browserUtf8ToBase64;
5655
export const base64ToUtf8 = isNode ? nodeBase64ToUtf8 : browserBase64ToUtf8;
57-
58-
/* v8 ignore stop */

vite.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import { defineConfig } from "vite";
33
export default defineConfig({
44
test: {
55
coverage: {
6+
provider: "v8",
67
include: ["src/**/*.ts"],
7-
ignore: ["src/utils.ts"],
8+
exclude: ["src/utils.ts"],
89
reporter: ["html", "text", "json"],
910
thresholds: {
1011
100: true,

0 commit comments

Comments
 (0)