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:
Sammy Jelin
2017-01-17 16:03:46 -08:00
committed by Mohamed Hegazy
parent f54bb800a0
commit 8e08375093

View File

@@ -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;