mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
Explain how to use custom matchers (#13957)
The test only compile because `jasmine-tests.ts` doesn't import or export anything, and so the typescript compiler thinks it is a global definition file. I've added a note explaining how normal users would declare their custom matchers.
This commit is contained in:
committed by
Mohamed Hegazy
parent
f54bb800a0
commit
8e08375093
@@ -872,6 +872,14 @@ var customMatchers: jasmine.CustomMatcherFactories = {
|
||||
}
|
||||
};
|
||||
// add the custom matchers to interface jasmine.Matchers via TypeScript declaration merging
|
||||
// if your test files import or export anything, you'll want to use:
|
||||
// declare global {
|
||||
// namespace jasmine {
|
||||
// interface Matchers {
|
||||
// ...
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
declare namespace jasmine {
|
||||
interface Matchers {
|
||||
toBeGoofy(expected?: any): boolean;
|
||||
|
||||
Reference in New Issue
Block a user