Skip to content

Commit 7f25709

Browse files
committed
refactor test
1 parent 132cf65 commit 7f25709

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
const first = ['15', '32', '12']
2-
const rest = ['3']
32

43
const excepted = {
5-
0: first.sort(),
6-
1: rest.sort(),
7-
2: first.sort()
4+
0: first,
5+
1: ['3'],
6+
2: first
87
}
98

109
module.exports = excepted

tests/assets/data-tests/label/index.cjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,11 @@ const testCases = [
1717
}
1818
]
1919

20+
for (const testCase in testCases) {
21+
const excepted = testCases[testCase].excepted
22+
if (Array.isArray(excepted)) {
23+
testCases[testCase].excepted = excepted.sort()
24+
}
25+
}
26+
2027
module.exports = testCases

tests/assets/data-tests/label/olympics.cjs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,4 @@ const excepted = {
332332
57: first
333333
}
334334

335-
for (const key in excepted) {
336-
if (Array.isArray(excepted[key])) {
337-
excepted[key] = excepted[key].sort()
338-
}
339-
}
340-
341335
module.exports = excepted

0 commit comments

Comments
 (0)