-
Notifications
You must be signed in to change notification settings - Fork 30
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
1 parent
8d52c1b
commit dd79e29
Showing
3 changed files
with
25 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { parseRawDelay } from '../../src/helpers'; | ||
|
||
const { test, module } = QUnit; | ||
const name = 'scriptlets-redirects helpers'; | ||
|
||
module(name); | ||
test('Test parseRawDelay', (assert) => { | ||
assert.strictEqual(parseRawDelay(0), 0, 'parsing number ok'); | ||
assert.strictEqual(parseRawDelay(10), 10, 'parsing number ok'); | ||
assert.strictEqual(parseRawDelay(10.123), 10, 'parsing number ok'); | ||
|
||
assert.strictEqual(parseRawDelay('0'), 0, 'parsing number in string ok'); | ||
assert.strictEqual(parseRawDelay('10'), 10, 'parsing number in string ok'); | ||
assert.strictEqual(parseRawDelay('10.123'), 10, 'parsing number in string ok'); | ||
|
||
assert.strictEqual(parseRawDelay('string'), 'string', 'parsing string ok'); | ||
|
||
assert.strictEqual(parseRawDelay(null), null, 'parsing other types ok'); | ||
assert.strictEqual(parseRawDelay(undefined), undefined, 'parsing other types ok'); | ||
assert.strictEqual(parseRawDelay(false), false, 'parsing other types ok'); | ||
// as NaN !== NaN | ||
assert.strictEqual(parseRawDelay(NaN).toString(), 'NaN', 'parsing other types ok'); | ||
}); |
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