-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
X from class to namespace
- Loading branch information
Showing
9 changed files
with
51 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Normally, a unit test will return true or false to determine if it passes or fails. If this is the case, you almost certainly want to use the `X.true()` function. `X.false()` can be used if a test needs to return false in order to pass. Here are a few simple examples of tests that will always pass using these functions. | ||
Normally, a unit test will return true or false to determine if it passes or fails. If this is the case, you almost certainly want to use the `X.isTrue()` function. `X.isFalse()` can be used if a test needs to return false in order to pass. Here are a few simple examples of tests that will always pass using these functions. |
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
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 |
---|---|---|
@@ -1,17 +1,20 @@ | ||
import { X } from './index'; | ||
|
||
X.true(true); | ||
X.false(false); | ||
X.isTrue(true); | ||
X.isFalse(false); | ||
X.eq(1, 1); | ||
X.ge(1, 1); | ||
X.ge(2, 1); | ||
X.gt(2, 1); | ||
|
||
try { | ||
X.true(false); | ||
X.isTrue(false); | ||
} catch (e) { | ||
X.is((e as Error).message, 'Exception found in test #4! The test returned false.'); | ||
X.is((e as Error).message, 'Exception found in test #7! The test returned false.'); | ||
} | ||
|
||
try { | ||
X.ne(1, 1, 'Custom'); | ||
} catch (e) { | ||
X.is((e as Error).message, 'Exception found in test #6! Custom'); | ||
X.is((e as Error).message, 'Exception found in test #9! Custom'); | ||
} |