Skip to content

Commit

Permalink
✅ Fix line endings issue for windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
skerit committed Feb 14, 2024
1 parent ba10ebd commit 4d6921e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/function.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,13 @@ string` + `another

let tokens = Function.tokenize(fnc, true);

// Windows line endings stuff
for (let token of tokens) {
if (typeof token.value == 'string') {
token.value = token.value.replaceAll('\r\n', '\n');
}
}

assert.deepStrictEqual(tokens, [
{ type: 'parens', value: '(', line_start: 0, line_end: 0 },
{ type: 'name', value: 'a', line_start: 0, line_end: 0 },
Expand Down

0 comments on commit 4d6921e

Please sign in to comment.