Skip to content

Commit a33a2e1

Browse files
committedFeb 20, 2024
test: test with node 20
1 parent 930fe7b commit a33a2e1

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed
 

‎.github/workflows/autofix.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: autofix.ci # needed to securely identify the workflow
1+
name: autofix.ci # needed to securely identify the workflow
22

33
on:
44
pull_request:
55
push:
6-
branches: [ "main" ]
6+
branches: ["main"]
77

88
permissions:
99
contents: read
@@ -16,11 +16,11 @@ jobs:
1616
- run: corepack enable
1717
- uses: actions/setup-node@v4
1818
with:
19-
node-version: 18
19+
node-version: 20
2020
cache: "pnpm"
2121
- run: pnpm install
2222
- name: Fix lint issues
2323
run: pnpm run lint:fix
2424
- uses: autofix-ci/action@ea32e3a12414e6d3183163c3424a7d7a8631ad84
2525
with:
26-
commit-message: 'chore: apply automated lint fixes'
26+
commit-message: "chore: apply automated lint fixes"

‎.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- run: corepack enable
1717
- uses: actions/setup-node@v4
1818
with:
19-
node-version: 18
19+
node-version: 20
2020
cache: "pnpm"
2121
- run: pnpm install
2222
- run: pnpm lint

‎test/index.test.ts

+10-8
Original file line numberDiff line numberDiff line change
@@ -143,20 +143,22 @@ describe("destr", () => {
143143
}
144144
});
145145

146-
it("throws an error if it's a invalid JSON texts with safeDestr", () => {
146+
describe("throws an error if it's a invalid JSON texts with safeDestr", () => {
147147
const testCases = [
148-
{ input: "{ ", output: "Unexpected end of JSON input" },
148+
{ input: "{ ", output: "Expected property name or" },
149149
{ input: "[ ", output: "Unexpected end of JSON input" },
150-
{ input: '" ', output: "Unexpected end of JSON input" },
151-
{ input: "[1,2,3]?", output: "Unexpected token" },
150+
{ input: '" ', output: "Unterminated string in JSON at position" },
151+
{ input: "[1,2,3]?", output: "Unexpected non-whitespace character" },
152152
{ input: "invalid JSON text", output: "Invalid JSON" },
153-
{ input: ' "Invalid', output: "Unexpected end of JSON input" },
153+
{ input: ' "Invalid', output: "Unterminated string in JSON at position" },
154154
];
155155

156156
for (const testCase of testCases) {
157-
expect(() => safeDestr(testCase.input)).toThrowError(
158-
testCase.output || "",
159-
);
157+
it(testCase.input, () => {
158+
expect(() => safeDestr(testCase.input)).toThrowError(
159+
testCase.output || "",
160+
);
161+
});
160162
}
161163
});
162164

0 commit comments

Comments
 (0)
Please sign in to comment.