Skip to content

Commit a6180a3

Browse files
committed
⚒ fix tests to support Node 12
1 parent d68b435 commit a6180a3

File tree

10 files changed

+122
-123
lines changed

10 files changed

+122
-123
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ node_js:
55
- "6.5"
66
- "8"
77
- "10"
8+
- "12"
89

910
after_success:
1011
- npm run coveralls

scripts/clone-without-circular.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function getRelativePath(
6464
const fromPath = pathMap.get(from)
6565
const toPath = pathMap.get(to)
6666
try {
67-
return `♻️${relative(fromPath, toPath)}`
67+
return `♻️${relative(fromPath, toPath).replace(/\/$/u, "")}`
6868
} catch (err) {
6969
console.error(fromPath, toPath, err.stack)
7070
return "💥💥💥💥💥💥💥💥"

test/fixtures/parser/literal.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,19 @@ const fixturesRoot = path.join(__dirname, "literal")
1717
for (const filename of fs.readdirSync(fixturesRoot)) {
1818
Fixtures[filename] = JSON.parse(
1919
fs.readFileSync(path.join(fixturesRoot, filename), "utf8"),
20+
(_, v) => (v === "$$Infinity" ? Infinity : v),
2021
)
2122
}
2223

2324
export function save(): void {
2425
for (const filename of Object.keys(Fixtures)) {
2526
fs.writeFileSync(
2627
path.join(fixturesRoot, filename),
27-
JSON.stringify(Fixtures[filename], null, 2),
28+
JSON.stringify(
29+
Fixtures[filename],
30+
(_, v) => (v === Infinity ? "$$Infinity" : v),
31+
2,
32+
),
2833
)
2934
}
3035
}

test/fixtures/parser/literal/basic-valid-2015-u.json

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@
651651
"end": 3,
652652
"raw": "a*",
653653
"min": 0,
654-
"max": null,
654+
"max": "$$Infinity",
655655
"greedy": true,
656656
"element": {
657657
"type": "Character",
@@ -709,7 +709,7 @@
709709
"end": 3,
710710
"raw": "a+",
711711
"min": 1,
712-
"max": null,
712+
"max": "$$Infinity",
713713
"greedy": true,
714714
"element": {
715715
"type": "Character",
@@ -883,7 +883,7 @@
883883
"end": 6,
884884
"raw": "a{1,}",
885885
"min": 1,
886-
"max": null,
886+
"max": "$$Infinity",
887887
"greedy": true,
888888
"element": {
889889
"type": "Character",
@@ -999,7 +999,7 @@
999999
"end": 4,
10001000
"raw": "a*?",
10011001
"min": 0,
1002-
"max": null,
1002+
"max": "$$Infinity",
10031003
"greedy": false,
10041004
"element": {
10051005
"type": "Character",
@@ -1057,7 +1057,7 @@
10571057
"end": 4,
10581058
"raw": "a+?",
10591059
"min": 1,
1060-
"max": null,
1060+
"max": "$$Infinity",
10611061
"greedy": false,
10621062
"element": {
10631063
"type": "Character",
@@ -1231,7 +1231,7 @@
12311231
"end": 7,
12321232
"raw": "a{1,}?",
12331233
"min": 1,
1234-
"max": null,
1234+
"max": "$$Infinity",
12351235
"greedy": false,
12361236
"element": {
12371237
"type": "Character",
@@ -7864,7 +7864,7 @@
78647864
"end": 8,
78657865
"raw": "[0-9]*",
78667866
"min": 0,
7867-
"max": null,
7867+
"max": "$$Infinity",
78687868
"greedy": true,
78697869
"element": {
78707870
"type": "CharacterClass",
@@ -7963,7 +7963,7 @@
79637963
"end": 8,
79647964
"raw": "[0-9]+",
79657965
"min": 1,
7966-
"max": null,
7966+
"max": "$$Infinity",
79677967
"greedy": true,
79687968
"element": {
79697969
"type": "CharacterClass",
@@ -8062,7 +8062,7 @@
80628062
"end": 11,
80638063
"raw": "[a-zA-Z]*",
80648064
"min": 0,
8065-
"max": null,
8065+
"max": "$$Infinity",
80668066
"greedy": true,
80678067
"element": {
80688068
"type": "CharacterClass",
@@ -8184,7 +8184,7 @@
81848184
"end": 11,
81858185
"raw": "[a-zA-Z]+",
81868186
"min": 1,
8187-
"max": null,
8187+
"max": "$$Infinity",
81888188
"greedy": true,
81898189
"element": {
81908190
"type": "CharacterClass",
@@ -8306,7 +8306,7 @@
83068306
"end": 14,
83078307
"raw": "[0-9a-zA-Z]*",
83088308
"min": 0,
8309-
"max": null,
8309+
"max": "$$Infinity",
83108310
"greedy": true,
83118311
"element": {
83128312
"type": "CharacterClass",
@@ -8451,7 +8451,7 @@
84518451
"end": 27,
84528452
"raw": "[a-zA-Z0-9!-/:-@\\[-`{-~]*",
84538453
"min": 0,
8454-
"max": null,
8454+
"max": "$$Infinity",
84558455
"greedy": true,
84568456
"element": {
84578457
"type": "CharacterClass",
@@ -8703,7 +8703,7 @@
87038703
"end": 18,
87048704
"raw": "[a-zA-Z0-9]{8,}",
87058705
"min": 8,
8706-
"max": null,
8706+
"max": "$$Infinity",
87078707
"greedy": true,
87088708
"element": {
87098709
"type": "CharacterClass",
@@ -9640,7 +9640,7 @@
96409640
"end": 14,
96419641
"raw": "[0-9]*",
96429642
"min": 0,
9643-
"max": null,
9643+
"max": "$$Infinity",
96449644
"greedy": true,
96459645
"element": {
96469646
"type": "CharacterClass",
@@ -9737,7 +9737,7 @@
97379737
"end": 26,
97389738
"raw": "[0-9]+",
97399739
"min": 1,
9740-
"max": null,
9740+
"max": "$$Infinity",
97419741
"greedy": true,
97429742
"element": {
97439743
"type": "CharacterClass",
@@ -9908,7 +9908,7 @@
99089908
"end": 16,
99099909
"raw": "[0-9]*",
99109910
"min": 0,
9911-
"max": null,
9911+
"max": "$$Infinity",
99129912
"greedy": true,
99139913
"element": {
99149914
"type": "CharacterClass",
@@ -10005,7 +10005,7 @@
1000510005
"end": 28,
1000610006
"raw": "[0-9]+",
1000710007
"min": 1,
10008-
"max": null,
10008+
"max": "$$Infinity",
1000910009
"greedy": true,
1001010010
"element": {
1001110011
"type": "CharacterClass",
@@ -10110,7 +10110,7 @@
1011010110
"end": 9,
1011110111
"raw": "[ぁ-んー]*",
1011210112
"min": 0,
10113-
"max": null,
10113+
"max": "$$Infinity",
1011410114
"greedy": true,
1011510115
"element": {
1011610116
"type": "CharacterClass",
@@ -10217,7 +10217,7 @@
1021710217
"end": 10,
1021810218
"raw": "[ァ-ンヴー]*",
1021910219
"min": 0,
10220-
"max": null,
10220+
"max": "$$Infinity",
1022110221
"greedy": true,
1022210222
"element": {
1022310223
"type": "CharacterClass",
@@ -10332,7 +10332,7 @@
1033210332
"end": 12,
1033310333
"raw": "[ァ-ン゙゚\\-]*",
1033410334
"min": 0,
10335-
"max": null,
10335+
"max": "$$Infinity",
1033610336
"greedy": true,
1033710337
"element": {
1033810338
"type": "CharacterClass",
@@ -10455,7 +10455,7 @@
1045510455
"end": 15,
1045610456
"raw": "[^\\x20-\\x7e]*",
1045710457
"min": 0,
10458-
"max": null,
10458+
"max": "$$Infinity",
1045910459
"greedy": true,
1046010460
"element": {
1046110461
"type": "CharacterClass",
@@ -10554,7 +10554,7 @@
1055410554
"end": 34,
1055510555
"raw": "[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+",
1055610556
"min": 1,
10557-
"max": null,
10557+
"max": "$$Infinity",
1055810558
"greedy": true,
1055910559
"element": {
1056010560
"type": "CharacterClass",
@@ -10811,7 +10811,7 @@
1081110811
"end": 48,
1081210812
"raw": "[a-zA-Z0-9-]+",
1081310813
"min": 1,
10814-
"max": null,
10814+
"max": "$$Infinity",
1081510815
"greedy": true,
1081610816
"element": {
1081710817
"type": "CharacterClass",
@@ -10908,7 +10908,7 @@
1090810908
"end": 68,
1090910909
"raw": "(?:\\.[a-zA-Z0-9-]+)*",
1091010910
"min": 0,
10911-
"max": null,
10911+
"max": "$$Infinity",
1091210912
"greedy": true,
1091310913
"element": {
1091410914
"type": "Group",
@@ -10939,7 +10939,7 @@
1093910939
"end": 66,
1094010940
"raw": "[a-zA-Z0-9-]+",
1094110941
"min": 1,
10942-
"max": null,
10942+
"max": "$$Infinity",
1094310943
"greedy": true,
1094410944
"element": {
1094510945
"type": "CharacterClass",
@@ -11665,7 +11665,7 @@
1166511665
"end": 5,
1166611666
"raw": "\\s*",
1166711667
"min": 0,
11668-
"max": null,
11668+
"max": "$$Infinity",
1166911669
"greedy": true,
1167011670
"element": {
1167111671
"type": "CharacterSet",
@@ -11693,7 +11693,7 @@
1169311693
"end": 9,
1169411694
"raw": "\\s*",
1169511695
"min": 0,
11696-
"max": null,
11696+
"max": "$$Infinity",
1169711697
"greedy": true,
1169811698
"element": {
1169911699
"type": "CharacterSet",

0 commit comments

Comments
 (0)