-
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.
- Loading branch information
1 parent
e37cdf8
commit 2d8da7d
Showing
5 changed files
with
35 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import BaseTest from './BaseTest' | ||
import test from './decorators' | ||
import assert from './assert' | ||
|
||
interface ICustomObj { | ||
testStr: string | ||
} | ||
|
||
export default class AssertTest extends BaseTest { | ||
@test('can assert types') | ||
protected static async doesCallBeforeAll() { | ||
assert.expectType<string>('string') | ||
assert.expectType<number>(123) | ||
|
||
const myCustomObj: ICustomObj = { | ||
testStr: 'blah' | ||
} | ||
|
||
assert.expectType<ICustomObj>(myCustomObj) | ||
} | ||
} |
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,12 +1,15 @@ | ||
import { assert } from 'chai' | ||
|
||
export interface ISpruceAssert extends Chai.AssertStatic {} | ||
import { expectType } from 'ts-expect' | ||
|
||
// TODO: We could extend assert here | ||
/** | ||
* 馃尣馃 Assert things in tests | ||
* | ||
* Extends the chai assert library: https://www.chaijs.com/api/assert/ | ||
* */ | ||
const spruceAssert: ISpruceAssert = assert | ||
const spruceAssert = { | ||
...assert, | ||
expectType | ||
} | ||
|
||
export default spruceAssert |
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