Skip to content

Commit 2b2ca32

Browse files
committed
Add tests for Node type
1 parent 5825f26 commit 2b2ca32

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

src/internal/type/Blockquote.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import type {Replace} from "../../public/Replace.js"
12
import type {Node} from "../../public/Node.js"
23

3-
import type {Replace} from "../../public/Replace.js"
44
import type {InlineDescendant} from "./InlineDescendant.js"
55

66
import {ELEMENT_BLOCKQUOTE} from "../constants.js"

src/public/Node.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import test from "ava"
2+
3+
import {expectType} from "ts-expect"
4+
5+
import type {TypeOf} from "ts-expect"
6+
import type {Element} from "slate"
7+
8+
import type {Node} from "./Node.js"
9+
10+
test("Node type is assignable to Element type", t => {
11+
expectType<TypeOf<Element, Node>>(true)
12+
13+
t.pass()
14+
})

src/public/Node.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type {Element} from "slate"
22

33
import type {InlineDescendant} from "../internal/type/InlineDescendant.js"
44
import type {WithId} from "../internal/type/WithId.js"
5+
56
import type {Replace} from "./Replace.js"
67

78
export type Node<T extends string = string> = Replace<Element, {

0 commit comments

Comments
 (0)