Skip to content

Commit

Permalink
Migrate to jest for testing
Browse files Browse the repository at this point in the history
Snapshots are a perfect tool for testing this package.
  • Loading branch information
akkumar authored and xzyfer committed Apr 16, 2018
1 parent 3aff7c8 commit 685bf60
Show file tree
Hide file tree
Showing 18 changed files with 685 additions and 200 deletions.
275 changes: 275 additions & 0 deletions __tests__/__snapshots__/comment.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,275 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Comment should tokenize a comment that does not have a space before the end 1`] = `
Array [
Array [
"startComment",
"/*",
1,
2,
],
Array [
"word",
"my",
1,
3,
1,
4,
],
Array [
"space",
" ",
],
Array [
"word",
"comment",
1,
6,
1,
12,
],
Array [
"endComment",
"*/",
1,
14,
],
]
`;

exports[`Comment should tokenize a docblock comment 1`] = `
Array [
Array [
"startComment",
"/*",
1,
2,
],
Array [
"word",
"*",
1,
3,
1,
3,
],
Array [
"newline",
"
",
2,
0,
],
Array [
"space",
" ",
],
Array [
"word",
"*",
2,
2,
2,
2,
],
Array [
"space",
" ",
],
Array [
"word",
"line",
2,
4,
2,
7,
],
Array [
"space",
" ",
],
Array [
"word",
"1",
2,
9,
2,
9,
],
Array [
"newline",
"
",
3,
0,
],
Array [
"space",
" ",
],
Array [
"word",
"*",
3,
2,
3,
2,
],
Array [
"newline",
"
",
4,
0,
],
Array [
"space",
" ",
],
Array [
"word",
"*",
4,
2,
4,
2,
],
Array [
"space",
" ",
],
Array [
"word",
"line",
4,
4,
4,
7,
],
Array [
"space",
" ",
],
Array [
"word",
"2",
4,
9,
4,
9,
],
Array [
"newline",
"
",
5,
0,
],
Array [
"space",
" ",
],
Array [
"endComment",
"*/",
5,
3,
],
]
`;

exports[`Comment should tokenize a multiline comment 1`] = `
Array [
Array [
"startComment",
"/*",
1,
2,
],
Array [
"newline",
"
",
2,
0,
],
Array [
"word",
"my",
2,
1,
2,
2,
],
Array [
"space",
" ",
],
Array [
"word",
"comment",
2,
4,
2,
10,
],
Array [
"newline",
"
",
3,
0,
],
Array [
"endComment",
"*/",
3,
2,
],
]
`;

exports[`Comment should tokenize a simple comment 1`] = `
Array [
Array [
"startComment",
"/*",
1,
2,
],
Array [
"space",
" ",
],
Array [
"word",
"my",
1,
4,
1,
5,
],
Array [
"space",
" ",
],
Array [
"word",
"comment",
1,
7,
1,
13,
],
Array [
"space",
" ",
],
Array [
"endComment",
"*/",
1,
16,
],
]
`;
Loading

0 comments on commit 685bf60

Please sign in to comment.