-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Lexus Drumgold <[email protected]>
- Loading branch information
1 parent
2641b5f
commit ccb141f
Showing
162 changed files
with
5,641 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* @file Type Tests - docast | ||
* @module docast/nodes/tests/unit-d/docast | ||
*/ | ||
|
||
import type * as TestSubject from '@flex-development/docast' | ||
import type { Children } from '@flex-development/unist-util-types' | ||
import type { Node } from 'unist' | ||
|
||
describe('unit-d:docast', () => { | ||
describe('DocastNode', () => { | ||
type Subject = TestSubject.DocastNode | ||
|
||
it('should be union of nodes', () => { | ||
expectTypeOf<Extract<Subject, Node>>().toEqualTypeOf<Subject>() | ||
}) | ||
}) | ||
|
||
describe('Extract<AnyParent, DocastNode>', () => { | ||
type Subject = Extract<TestSubject.AnyParent, TestSubject.DocastNode> | ||
|
||
it('should override Parent["children"]', () => { | ||
// Arrange | ||
type Helper<T extends unknown[]> = T extends Children<TestSubject.Parent> | ||
? Children<TestSubject.Parent> extends T ? 0 : 1 | ||
: unknown | ||
|
||
// Expect | ||
expectTypeOf<Helper<Children<Subject>>>().toEqualTypeOf<1>() | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.