Skip to content

Commit 82d6080

Browse files
authored
Merge pull request #1718 from progfay/renew-jest
Renew jest
2 parents fee99ea + 3e34771 commit 82d6080

24 files changed

+1310
-1282
lines changed

jest.config.mjs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
export default {
1+
import { createDefaultPreset } from "ts-jest";
2+
3+
/** @type {import("ts-jest").JestConfigWithTsJest} */
4+
const config = {
25
moduleFileExtensions: ["ts", "js"],
36
transform: {
4-
"^.+\\.(ts|tsx)$": "ts-jest",
5-
},
6-
globals: {
7-
"ts-jest": {
8-
tsconfig: "tsconfig.json",
9-
},
7+
...createDefaultPreset().transform,
108
},
119
collectCoverageFrom: ["src/**/*.ts"],
1210
setupFilesAfterEnv: ["./tests/jest-setup.ts"],
1311
testMatch: ["**/tests/**/*.test.ts"],
1412
};
13+
14+
export default config;

tests/codeBlock/__snapshots__/index.test.ts.snap

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`Code Block Bulleted code block 1`] = `
4-
Array [
5-
Object {
4+
[
5+
{
66
"content": "function () {
77
alert(document.location.href)
8-
console.log(\\"hello\\")
8+
console.log("hello")
99
// You can also write comments!
1010
}",
1111
"fileName": "hello.js",
@@ -16,32 +16,32 @@ Array [
1616
`;
1717

1818
exports[`Code Block Code block with bullet 1`] = `
19-
Array [
20-
Object {
19+
[
20+
{
2121
"indent": 1,
22-
"nodes": Array [
23-
Object {
22+
"nodes": [
23+
{
2424
"raw": "Bullet",
2525
"text": "Bullet",
2626
"type": "plain",
2727
},
2828
],
2929
"type": "line",
3030
},
31-
Object {
31+
{
3232
"content": "function () {
3333
alert(document.location.href)
34-
console.log(\\"hello\\")
34+
console.log("hello")
3535
// You can also write comments!
3636
}",
3737
"fileName": "hello.js",
3838
"indent": 1,
3939
"type": "codeBlock",
4040
},
41-
Object {
41+
{
4242
"indent": 1,
43-
"nodes": Array [
44-
Object {
43+
"nodes": [
44+
{
4545
"raw": "Bullet",
4646
"text": "Bullet",
4747
"type": "plain",
@@ -53,21 +53,21 @@ Array [
5353
`;
5454

5555
exports[`Code Block Consecutive code blocks 1`] = `
56-
Array [
57-
Object {
56+
[
57+
{
5858
"content": "function () {
5959
alert(document.location.href)
60-
console.log(\\"hello\\")
60+
console.log("hello")
6161
// You can also write comments!
6262
}",
6363
"fileName": "hello.js",
6464
"indent": 0,
6565
"type": "codeBlock",
6666
},
67-
Object {
67+
{
6868
"content": "function () {
6969
alert(document.location.href)
70-
console.log(\\"hello\\")
70+
console.log("hello")
7171
// You can also write comments!
7272
}",
7373
"fileName": "hello.js",
@@ -78,11 +78,11 @@ Array [
7878
`;
7979

8080
exports[`Code Block Simple code block 1`] = `
81-
Array [
82-
Object {
81+
[
82+
{
8383
"content": "function () {
8484
alert(document.location.href)
85-
console.log(\\"hello\\")
85+
console.log("hello")
8686
// You can also write comments!
8787
}",
8888
"fileName": "hello.js",

tests/line/__snapshots__/blank.test.ts.snap

+32-32
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`blank [] is not blank 1`] = `
4-
Array [
5-
Object {
4+
[
5+
{
66
"indent": 0,
7-
"nodes": Array [
8-
Object {
7+
"nodes": [
8+
{
99
"raw": "[]",
1010
"text": "[]",
1111
"type": "plain",
@@ -17,21 +17,21 @@ Array [
1717
`;
1818

1919
exports[`blank Blank in the [*** ] 1`] = `
20-
Array [
21-
Object {
20+
[
21+
{
2222
"indent": 0,
23-
"nodes": Array [
24-
Object {
23+
"nodes": [
24+
{
2525
"raw": "[*** ",
2626
"text": "[*** ",
2727
"type": "plain",
2828
},
29-
Object {
29+
{
3030
"raw": "[ ]",
3131
"text": " ",
3232
"type": "blank",
3333
},
34-
Object {
34+
{
3535
"raw": "]",
3636
"text": "]",
3737
"type": "plain",
@@ -43,21 +43,21 @@ Array [
4343
`;
4444

4545
exports[`blank Blank in the sentence 1`] = `
46-
Array [
47-
Object {
46+
[
47+
{
4848
"indent": 0,
49-
"nodes": Array [
50-
Object {
49+
"nodes": [
50+
{
5151
"raw": "sentence",
5252
"text": "sentence",
5353
"type": "plain",
5454
},
55-
Object {
55+
{
5656
"raw": "[ ]",
5757
"text": " ",
5858
"type": "blank",
5959
},
60-
Object {
60+
{
6161
"raw": "sentence",
6262
"text": "sentence",
6363
"type": "plain",
@@ -69,11 +69,11 @@ Array [
6969
`;
7070

7171
exports[`blank Multi char blank 1`] = `
72-
Array [
73-
Object {
72+
[
73+
{
7474
"indent": 0,
75-
"nodes": Array [
76-
Object {
75+
"nodes": [
76+
{
7777
"raw": "[     ]",
7878
"text": "     ",
7979
"type": "blank",
@@ -85,11 +85,11 @@ Array [
8585
`;
8686

8787
exports[`blank Simple double-byte space blank 1`] = `
88-
Array [
89-
Object {
88+
[
89+
{
9090
"indent": 0,
91-
"nodes": Array [
92-
Object {
91+
"nodes": [
92+
{
9393
"raw": "[ ]",
9494
"text": " ",
9595
"type": "blank",
@@ -101,11 +101,11 @@ Array [
101101
`;
102102

103103
exports[`blank Simple half-space blank 1`] = `
104-
Array [
105-
Object {
104+
[
105+
{
106106
"indent": 0,
107-
"nodes": Array [
108-
Object {
107+
"nodes": [
108+
{
109109
"raw": "[ ]",
110110
"text": " ",
111111
"type": "blank",
@@ -117,11 +117,11 @@ Array [
117117
`;
118118

119119
exports[`blank Simple tab blank 1`] = `
120-
Array [
121-
Object {
120+
[
121+
{
122122
"indent": 0,
123-
"nodes": Array [
124-
Object {
123+
"nodes": [
124+
{
125125
"raw": "[ ]",
126126
"text": " ",
127127
"type": "blank",

tests/line/__snapshots__/bullet.test.ts.snap

+25-25
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`bullet Double-byte space indent 1`] = `
4-
Array [
5-
Object {
4+
[
5+
{
66
"indent": 1,
7-
"nodes": Array [
8-
Object {
7+
"nodes": [
8+
{
99
"raw": "Double-byte space",
1010
"text": "Double-byte space",
1111
"type": "plain",
@@ -17,44 +17,44 @@ Array [
1717
`;
1818

1919
exports[`bullet Multi lines bullet 1`] = `
20-
Array [
21-
Object {
20+
[
21+
{
2222
"indent": 0,
23-
"nodes": Array [
24-
Object {
23+
"nodes": [
24+
{
2525
"raw": "no bullet (indent: 0)",
2626
"text": "no bullet (indent: 0)",
2727
"type": "plain",
2828
},
2929
],
3030
"type": "line",
3131
},
32-
Object {
32+
{
3333
"indent": 1,
34-
"nodes": Array [
35-
Object {
34+
"nodes": [
35+
{
3636
"raw": "first bullet (indent: 1)",
3737
"text": "first bullet (indent: 1)",
3838
"type": "plain",
3939
},
4040
],
4141
"type": "line",
4242
},
43-
Object {
43+
{
4444
"indent": 2,
45-
"nodes": Array [
46-
Object {
45+
"nodes": [
46+
{
4747
"raw": "second bullet (indent: 2)",
4848
"text": "second bullet (indent: 2)",
4949
"type": "plain",
5050
},
5151
],
5252
"type": "line",
5353
},
54-
Object {
54+
{
5555
"indent": 3,
56-
"nodes": Array [
57-
Object {
56+
"nodes": [
57+
{
5858
"raw": "third bullet (indent: 3)",
5959
"text": "third bullet (indent: 3)",
6060
"type": "plain",
@@ -66,11 +66,11 @@ Array [
6666
`;
6767

6868
exports[`bullet Single-byte space indent 1`] = `
69-
Array [
70-
Object {
69+
[
70+
{
7171
"indent": 1,
72-
"nodes": Array [
73-
Object {
72+
"nodes": [
73+
{
7474
"raw": "Single-byte space",
7575
"text": "Single-byte space",
7676
"type": "plain",
@@ -82,11 +82,11 @@ Array [
8282
`;
8383

8484
exports[`bullet Tab indent 1`] = `
85-
Array [
86-
Object {
85+
[
86+
{
8787
"indent": 1,
88-
"nodes": Array [
89-
Object {
88+
"nodes": [
89+
{
9090
"raw": "Tab",
9191
"text": "Tab",
9292
"type": "plain",

tests/line/__snapshots__/code.test.ts.snap

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`code Empty code with backquote 1`] = `
4-
Array [
5-
Object {
4+
[
5+
{
66
"indent": 0,
7-
"nodes": Array [
8-
Object {
7+
"nodes": [
8+
{
99
"raw": "\`\`",
1010
"text": "",
1111
"type": "code",
@@ -17,11 +17,11 @@ Array [
1717
`;
1818

1919
exports[`code Simple code with backquote 1`] = `
20-
Array [
21-
Object {
20+
[
21+
{
2222
"indent": 0,
23-
"nodes": Array [
24-
Object {
23+
"nodes": [
24+
{
2525
"raw": "\`Simple code\`",
2626
"text": "Simple code",
2727
"type": "code",

0 commit comments

Comments
 (0)