-
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.
fix(sfn): Pass support non-object Result types (#2811)
- Loading branch information
Showing
4 changed files
with
92 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
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(); | ||
}, | ||
'fromObject has proper value'(test: Test) { | ||
const testValue = {a: 1}; | ||
const result = Result.fromObject(testValue); | ||
test.deepEqual(result.value, testValue); | ||
|
||
test.done(); | ||
}, | ||
'fromArray has proper value'(test: Test) { | ||
const testValue = [1]; | ||
const result = Result.fromArray(testValue); | ||
test.deepEqual(result.value, testValue); | ||
|
||
test.done(); | ||
}, | ||
}; |