Skip to content

Commit 92a66fe

Browse files
committed
resolve assertion type error
- ref. microsoft/TypeScript#59787
1 parent 8dfb4d2 commit 92a66fe

File tree

6 files changed

+61
-62
lines changed

6 files changed

+61
-62
lines changed

package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
"version": "9.2.0",
44
"type": "module",
55
"description": "parse Scrapbox notation to JavaScript Object",
6-
"files": [
7-
"out"
8-
],
6+
"files": ["out"],
97
"main": "./out/index.cjs",
108
"module": "./out/index.mjs",
119
"types": "./out/index.d.ts",
@@ -32,10 +30,7 @@
3230
"type": "git",
3331
"url": "git+https://github.com/progfay/scrapbox-parser.git"
3432
},
35-
"keywords": [
36-
"scrapbox",
37-
"parser"
38-
],
33+
"keywords": ["scrapbox", "parser"],
3934
"author": "progfay",
4035
"license": "MIT",
4136
"bugs": {

tests/line/decoration.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { deepStrictEqual } from "node:assert/strict";
12
import { describe, it } from "node:test";
23
import {
34
type Decoration,
@@ -47,7 +48,7 @@ describe("decoration", () => {
4748
);
4849
});
4950

50-
it("All decoration", ({ assert }) => {
51+
it("All decoration", () => {
5152
const input = "[**********!\"#%&'()*+,-./{|}<>_~ decos]";
5253
const blocks = parse(input, { hasTitle: false });
5354
const received = ((blocks[0] as Line).nodes[0] as DecorationNode).decos;
@@ -74,7 +75,7 @@ describe("decoration", () => {
7475
"_",
7576
"~",
7677
];
77-
assert.deepStrictEqual(received.sort(), decos.sort());
78+
deepStrictEqual(received.sort(), decos.sort());
7879
});
7980

8081
it("Decoration * overflow", ({ assert }) => {

tests/line/icon.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { deepStrictEqual, strictEqual } from "node:assert/strict";
12
import { describe, it } from "node:test";
23
import { parse } from "../../src/index.ts";
34

@@ -22,14 +23,14 @@ describe("icon", () => {
2223
);
2324
});
2425

25-
it("Each multiple icon must be different Object", ({ assert }) => {
26+
it("Each multiple icon must be different Object", () => {
2627
const [block] = parse("[me.icon*2]", { hasTitle: false });
2728

2829
if (block === undefined || block.type !== "line") {
2930
throw new Error("fail");
3031
}
3132

32-
assert.strictEqual(block.nodes.length, 2);
33-
assert.deepStrictEqual(block.nodes[0], block.nodes[1]);
33+
strictEqual(block.nodes.length, 2);
34+
deepStrictEqual(block.nodes[0], block.nodes[1]);
3435
});
3536
});

tests/line/numberList.test.ts

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,55 @@ import { describe, it } from "node:test";
22
import { parse } from "../../src/index.ts";
33

44
describe("numberList", () => {
5-
it("Minimum numberList", ({ assert }) => {
6-
assert.snapshot(
7-
parse("1. ", {
8-
hasTitle: false,
9-
})
10-
);
11-
});
5+
it("Minimum numberList", ({ assert }) => {
6+
assert.snapshot(
7+
parse("1. ", {
8+
hasTitle: false,
9+
}),
10+
);
11+
});
1212

13-
it("Simple numberList", ({ assert }) => {
14-
assert.snapshot(
15-
parse("1. Simple numberList", {
16-
hasTitle: false,
17-
})
18-
);
19-
});
13+
it("Simple numberList", ({ assert }) => {
14+
assert.snapshot(
15+
parse("1. Simple numberList", {
16+
hasTitle: false,
17+
}),
18+
);
19+
});
2020

21-
it("1. with decoration", ({ assert }) => {
22-
assert.snapshot(
23-
parse("1. [* deco]", {
24-
hasTitle: false,
25-
})
26-
);
27-
});
21+
it("1. with decoration", ({ assert }) => {
22+
assert.snapshot(
23+
parse("1. [* deco]", {
24+
hasTitle: false,
25+
}),
26+
);
27+
});
2828

29-
it("1. with code", ({ assert }) => {
30-
assert.snapshot(
31-
parse("1. `code`", {
32-
hasTitle: false,
33-
})
34-
);
35-
});
29+
it("1. with code", ({ assert }) => {
30+
assert.snapshot(
31+
parse("1. `code`", {
32+
hasTitle: false,
33+
}),
34+
);
35+
});
3636

37-
it("1. with no space is not numberList", ({ assert }) => {
38-
assert.snapshot(
39-
parse("1.not numberList", {
40-
hasTitle: false,
41-
})
42-
);
43-
});
37+
it("1. with no space is not numberList", ({ assert }) => {
38+
assert.snapshot(
39+
parse("1.not numberList", {
40+
hasTitle: false,
41+
}),
42+
);
43+
});
4444

45-
it("No head 1. is not numberList", ({ assert }) => {
46-
assert.snapshot(
47-
parse("a 1. not numberList", {
48-
hasTitle: false,
49-
})
50-
);
51-
});
45+
it("No head 1. is not numberList", ({ assert }) => {
46+
assert.snapshot(
47+
parse("a 1. not numberList", {
48+
hasTitle: false,
49+
}),
50+
);
51+
});
5252

53-
it("Quoted 1. is not numberList", ({ assert }) => {
54-
assert.snapshot(parse("> 1. Quoted", { hasTitle: false }));
55-
});
53+
it("Quoted 1. is not numberList", ({ assert }) => {
54+
assert.snapshot(parse("> 1. Quoted", { hasTitle: false }));
55+
});
5656
});

tests/line/strongIcon.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { deepStrictEqual } from "node:assert/strict";
12
import { describe, it } from "node:test";
23
import { parse } from "../../src/index.ts";
34

@@ -33,6 +34,6 @@ describe("strongIcon", () => {
3334
}
3435

3536
assert.equal(block.nodes.length, 2);
36-
assert.deepStrictEqual(block.nodes[0], block.nodes[1]);
37+
deepStrictEqual(block.nodes[0], block.nodes[1]);
3738
});
3839
});

tests/title/index.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1+
import assert from "node:assert/strict";
12
import { describe, it } from "node:test";
23
import { getTitle } from "../../src/index.ts";
34

45
describe("title", () => {
5-
it("Get title from simple page", ({ assert }) => {
6+
it("Get title from simple page", () => {
67
const title = getTitle("title\nline\nline\n");
78
assert.strictEqual(title, "title");
89
});
910

10-
it("Get title from empty page", ({ assert }) => {
11+
it("Get title from empty page", () => {
1112
assert.strictEqual(getTitle(""), "Untitled");
1213
assert.strictEqual(getTitle("  \t"), "Untitled");
1314
assert.strictEqual(getTitle("\n"), "Untitled");
1415
assert.strictEqual(getTitle("\n  \t"), "Untitled");
1516
});
1617

17-
it("Get title from title only page", ({ assert }) => {
18+
it("Get title from title only page", () => {
1819
const title = getTitle("title");
1920
assert.strictEqual(title, "title");
2021
});
2122

22-
it("Get title from huge page", ({ assert }) => {
23+
it("Get title from huge page", () => {
2324
const title = getTitle(`${" \n".repeat(10 ** 8)}title`);
2425
assert.strictEqual(title, "title");
2526
});

0 commit comments

Comments
 (0)