Skip to content

Commit

Permalink
test: add further typescript tests
Browse files Browse the repository at this point in the history
  • Loading branch information
manuth committed Jun 29, 2022
1 parent 5b7af8a commit 970cb46
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/ts/test-ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import {

CommentArray,
CommentObject,
assign
assign,
CommentDescriptor,
CommentSymbol
} from '../..'

const assert = (test: boolean, message: string): void => {
Expand Down Expand Up @@ -33,3 +35,14 @@ assert(stringify(obj, null, 2) === `{
}`, 'assign')

assert(Array.isArray(tokenize(str)), 'tokenize')

const comment = "this is a comment"
let commentDescriptor: CommentDescriptor = `before:0`

const commentSrc = `[
//${comment}
"bar"
]`

assert((parse(commentSrc) as CommentArray<string>)[Symbol.for(commentDescriptor) as CommentSymbol][0].value === comment, 'comment parse')
commentDescriptor = "before";

0 comments on commit 970cb46

Please sign in to comment.