forked from Argonius-Angelus/lancer-clocks
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
133 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import test from 'ava'; | ||
|
||
import { Clock } from "../../module/scripts/clock.mjs"; | ||
|
||
test("returns a new Clock object", t => { | ||
const oldClock = new Clock({ | ||
progress: 1 | ||
}); | ||
const newClock = oldClock.decrement(); | ||
t.assert(newClock instanceof Clock); | ||
t.not(newClock, oldClock); | ||
}); | ||
|
||
test("decrements the previous progress by 1", t => { | ||
const oldClock = new Clock({ | ||
progress: 1 | ||
}); | ||
const newClock = oldClock.decrement(); | ||
t.is(newClock.progress, 0); | ||
}); | ||
|
||
test("does not alter the previous size", t => { | ||
const oldClock = new Clock({ | ||
size: 4, | ||
progress: 1 | ||
}); | ||
const newClock = oldClock.decrement(); | ||
t.is(newClock.size, 4); | ||
}); | ||
|
||
test("does not alter the previous theme", t => { | ||
const oldClock = new Clock({ | ||
theme: 'gms_red', | ||
progress: 1 | ||
}); | ||
const newClock = oldClock.decrement(); | ||
t.is(newClock.theme, 'gms_red'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import test from 'ava'; | ||
|
||
import { Clock } from "../../module/scripts/clock.mjs"; | ||
|
||
test("returns a new Clock object", t => { | ||
const oldClock = new Clock({ | ||
progress: 1 | ||
}); | ||
const newClock = oldClock.increment(); | ||
t.assert(newClock instanceof Clock); | ||
t.not(newClock, oldClock); | ||
}); | ||
|
||
test("increments the previous progress by 1", t => { | ||
const oldClock = new Clock({ | ||
progress: 1 | ||
}); | ||
const newClock = oldClock.increment(); | ||
t.is(newClock.progress, 2); | ||
}); | ||
|
||
test("does not alter the previous size", t => { | ||
const oldClock = new Clock({ | ||
size: 4, | ||
progress: 1 | ||
}); | ||
const newClock = oldClock.increment(); | ||
t.is(newClock.size, 4); | ||
}); | ||
|
||
test("does not alter the previous theme", t => { | ||
const oldClock = new Clock({ | ||
theme: 'gms_red', | ||
progress: 1 | ||
}); | ||
const newClock = oldClock.increment(); | ||
t.is(newClock.theme, 'gms_red'); | ||
}); |