From 8e08375093108eb791e7b1a47cec072e10fa92a4 Mon Sep 17 00:00:00 2001 From: Sammy Jelin Date: Tue, 17 Jan 2017 16:03:46 -0800 Subject: [PATCH] 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. --- jasmine/jasmine-tests.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/jasmine/jasmine-tests.ts b/jasmine/jasmine-tests.ts index 77aa8cbee3..4632eb8b4c 100644 --- a/jasmine/jasmine-tests.ts +++ b/jasmine/jasmine-tests.ts @@ -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;