Skip to content

Commit

Permalink
test(sleep): create possible values dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Jan 22, 2025
1 parent 285385e commit 778e6bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/unit/helpers/ModuleTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ export default class ModuleTest {
public async shouldBeAbleToGetAllModulesFirstExportMatchOrDefaultFromAnyPath({ assert }: Context) {
const modules = await Module.getAllFrom(Path.src('helpers'))

assert.lengthOf(modules, 23)
assert.lengthOf(modules, 24)
assert.equal(modules[0].name, 'Clean')
}

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

assert.lengthOf(modules, 23)
assert.lengthOf(modules, 24)
assert.equal(modules[0].module.name, 'Clean')
assert.equal(modules[0].alias, 'App/Helpers/Clean')
}
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/helpers/SleepTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class SleepTest {

const endDate = Date.now()

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

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

const endDate = Date.now()

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

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

const endDate = Date.now()

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

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

const endDate = Date.now()

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

assert.isTrue(possibleValues.includes(endDate - startDate))
}
Expand Down

0 comments on commit 778e6bc

Please sign in to comment.