-
-
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 <unicornware@flexdevelopment.llc>
- Loading branch information
1 parent
919c026
commit 31d233d
Showing
3 changed files
with
85 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* @file Type Tests - MultiLineComment | ||
* @module esast/nodes/tests/unit-d/MultiLineComment | ||
*/ | ||
|
||
import type { CommentData, Node } from '@flex-development/esast' | ||
import type { Optional } from '@flex-development/tutils' | ||
import type * as TestSubject from '../comment-multi-line' | ||
|
||
describe('unit-d:nodes/MultiLineComment', () => { | ||
type Subject = TestSubject.default | ||
type SubjectData = TestSubject.MultiLineCommentData | ||
|
||
it('should extend Node', () => { | ||
expectTypeOf<Subject>().toMatchTypeOf<Node>() | ||
}) | ||
|
||
it('should match [data?: Optional<MultiLineCommentData>]', () => { | ||
expectTypeOf<Subject>() | ||
.toHaveProperty('data') | ||
.toEqualTypeOf<Optional<SubjectData>>() | ||
}) | ||
|
||
it('should match [multi: true]', () => { | ||
expectTypeOf<Subject>().toHaveProperty('multi').toEqualTypeOf<true>() | ||
}) | ||
|
||
it('should match [type: "comment"]', () => { | ||
expectTypeOf<Subject>().toHaveProperty('type').toEqualTypeOf<'comment'>() | ||
}) | ||
|
||
describe('MultiLineCommentData', () => { | ||
it('should extend CommentData', () => { | ||
expectTypeOf<SubjectData>().toMatchTypeOf<CommentData>() | ||
}) | ||
}) | ||
}) |
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,44 @@ | ||
/** | ||
* @file Nodes - MultiLineComment | ||
* @module esast/nodes/MultiLineComment | ||
*/ | ||
|
||
import type { CommentData, Node } from '@flex-development/esast' | ||
import type { Optional } from '@flex-development/tutils' | ||
|
||
/** | ||
* Info associated with multi line comments. | ||
* | ||
* @see {@linkcode CommentData} | ||
* | ||
* @extends {CommentData} | ||
*/ | ||
interface MultiLineCommentData extends CommentData {} | ||
|
||
/** | ||
* A multi line comment. | ||
* | ||
* @see {@linkcode Node} | ||
* | ||
* @extends {Node} | ||
*/ | ||
interface MultiLineComment extends Node { | ||
/** | ||
* Info from the ecosystem. | ||
* | ||
* @see {@linkcode MultiLineCommentData} | ||
*/ | ||
data?: Optional<MultiLineCommentData> | ||
|
||
/** | ||
* Multi line comment marker. | ||
*/ | ||
multi: true | ||
|
||
/** | ||
* Node type. | ||
*/ | ||
type: 'comment' | ||
} | ||
|
||
export type { MultiLineCommentData, MultiLineComment as default } |
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