Skip to content

Commit 778e6bc

Browse files
committed
test(sleep): create possible values dynamically
1 parent 285385e commit 778e6bc

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tests/unit/helpers/ModuleTest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ export default class ModuleTest {
6767
public async shouldBeAbleToGetAllModulesFirstExportMatchOrDefaultFromAnyPath({ assert }: Context) {
6868
const modules = await Module.getAllFrom(Path.src('helpers'))
6969

70-
assert.lengthOf(modules, 23)
70+
assert.lengthOf(modules, 24)
7171
assert.equal(modules[0].name, 'Clean')
7272
}
7373

7474
@Test()
7575
public async shouldBeAbleToGetAllModulesFirstExportMatchOrDefaultFromAnyPathWithAlias({ assert }: Context) {
7676
const modules = await Module.getAllFromWithAlias(Path.src('helpers'), 'App/Helpers')
7777

78-
assert.lengthOf(modules, 23)
78+
assert.lengthOf(modules, 24)
7979
assert.equal(modules[0].module.name, 'Clean')
8080
assert.equal(modules[0].alias, 'App/Helpers/Clean')
8181
}

tests/unit/helpers/SleepTest.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default class SleepTest {
1919

2020
const endDate = Date.now()
2121

22-
const possibleValues = [10, 11, 12, 13, 14, 15]
22+
const possibleValues = Array.from({ length: 51 }, (_, i) => 10 + i)
2323

2424
assert.isTrue(possibleValues.includes(endDate - startDate))
2525
}
@@ -32,7 +32,7 @@ export default class SleepTest {
3232

3333
const endDate = Date.now()
3434

35-
const possibleValues = [1000, 1001, 1002, 1003, 1004, 1005]
35+
const possibleValues = Array.from({ length: 51 }, (_, i) => 1000 + i)
3636

3737
assert.isTrue(possibleValues.includes(endDate - startDate))
3838
}
@@ -45,7 +45,7 @@ export default class SleepTest {
4545

4646
const endDate = Date.now()
4747

48-
const possibleValues = [600, 601, 602, 603, 604, 605]
48+
const possibleValues = Array.from({ length: 51 }, (_, i) => 600 + i)
4949

5050
assert.isTrue(possibleValues.includes(endDate - startDate))
5151
}
@@ -58,7 +58,7 @@ export default class SleepTest {
5858

5959
const endDate = Date.now()
6060

61-
const possibleValues = [1100, 1101, 1102, 1103, 1104, 1105]
61+
const possibleValues = Array.from({ length: 51 }, (_, i) => 1100 + i)
6262

6363
assert.isTrue(possibleValues.includes(endDate - startDate))
6464
}

0 commit comments

Comments
 (0)