We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 820573d commit fb61d69Copy full SHA for fb61d69
libraries/rushell/src/test/Tokenizer.test.ts
@@ -17,10 +17,22 @@ function tokenize(input: string): Token[] {
17
18
function matchSnapshot(input: string): void {
19
const tokenizer: Tokenizer = new Tokenizer(input);
20
- expect({
21
- input: escape(tokenizer.input.toString()),
22
- tokens: tokenizer.getTokens().map(x => [TokenKind[x.kind], escape(x.toString())])
23
- }).toMatchSnapshot();
+
+ const reportedTokens = tokenizer.getTokens().map(
+ token => {
+ return {
24
+ kind: TokenKind[token.kind],
25
+ value: escape(token.toString())
26
+ }
27
28
+ );
29
30
+ expect(
31
+ {
32
+ input: escape(tokenizer.input.toString()),
33
+ tokens: reportedTokens
34
35
+ ).toMatchSnapshot();
36
}
37
38
test('00: empty inputs', () => {
0 commit comments