-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
spg
committed
Jun 14, 2019
1 parent
76abc6a
commit b5794ad
Showing
2 changed files
with
109 additions
and
6 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,33 @@ | ||
import { Test } from 'nodeunit'; | ||
import { Result } from "../lib"; | ||
|
||
export = { | ||
'fromString has proper value'(test: Test) { | ||
const testValue = 'test string'; | ||
const result = Result.fromString(testValue); | ||
test.equal(result.value, testValue); | ||
|
||
test.done(); | ||
}, | ||
'fromNumber has proper value'(test: Test) { | ||
const testValue = 1; | ||
const result = Result.fromNumber(testValue); | ||
test.equal(result.value, testValue); | ||
|
||
test.done(); | ||
}, | ||
'fromBoolean has proper value'(test: Test) { | ||
const testValue = false; | ||
const result = Result.fromBoolean(testValue); | ||
test.equal(result.value, testValue); | ||
|
||
test.done(); | ||
}, | ||
'fromMap has proper value'(test: Test) { | ||
const testValue = {a: 1}; | ||
const result = Result.fromMap(testValue); | ||
test.deepEqual(result.value, testValue); | ||
|
||
test.done(); | ||
}, | ||
}; |