UNPKG

51.6 kBTypeScriptView Raw
1// Type definitions for Jasmine 4.0
2// Project: http://jasmine.github.io
3// Definitions by: Boris Yankov <https://github.com/borisyankov>
4// Theodore Brown <https://github.com/theodorejb>
5// David Pärsson <https://github.com/davidparsson>
6// Lukas Zech <https://github.com/lukas-zech-software>
7// Boris Breuer <https://github.com/Engineer2B>
8// Chris Yungmann <https://github.com/cyungmann>
9// Giles Roadnight <https://github.com/Roaders>
10// Yaroslav Admin <https://github.com/devoto13>
11// Domas Trijonis <https://github.com/fdim>
12// Moshe Kolodny <https://github.com/kolodny>
13// Stephen Farrar <https://github.com/stephenfarrar>
14// Dominik Ehrenberg <https://github.com/djungowski>
15// Chives <https://github.com/chivesrs>
16// kirjs <https://github.com/kirjs>
17// Md. Enzam Hossain <https://github.com/ienzam>
18// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
19
20// For ddescribe / iit use : https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/karma-jasmine/karma-jasmine.d.ts
21
22/**
23 * @deprecated Use {@link jasmine.ImplementationCallback} instead.
24 */
25type ImplementationCallback = jasmine.ImplementationCallback;
26
27/**
28 * Create a group of specs (often called a suite).
29 * @param description Textual description of the group
30 * @param specDefinitions Function for Jasmine to invoke that will define inner suites a specs
31 */
32declare function describe(description: string, specDefinitions: () => void): void;
33
34/**
35 * A focused `describe`. If suites or specs are focused, only those that are focused will be executed.
36 * @param description Textual description of the group
37 * @param specDefinitions Function for Jasmine to invoke that will define inner suites a specs
38 */
39declare function fdescribe(description: string, specDefinitions: () => void): void;
40
41/**
42 * A temporarily disabled `describe`. Specs within an xdescribe will be marked pending and not executed.
43 * @param description Textual description of the group
44 * @param specDefinitions Function for Jasmine to invoke that will define inner suites a specs
45 */
46declare function xdescribe(description: string, specDefinitions: () => void): void;
47
48/**
49 * Define a single spec. A spec should contain one or more expectations that test the state of the code.
50 * A spec whose expectations all succeed will be passing and a spec with any failures will fail.
51 * @param expectation Textual description of what this spec is checking
52 * @param assertion Function that contains the code of your test. If not provided the test will be pending.
53 * @param timeout Custom timeout for an async spec.
54 */
55declare function it(expectation: string, assertion?: jasmine.ImplementationCallback, timeout?: number): void;
56
57/**
58 * A focused `it`. If suites or specs are focused, only those that are focused will be executed.
59 * @param expectation Textual description of what this spec is checking
60 * @param assertion Function that contains the code of your test. If not provided the test will be pending.
61 * @param timeout Custom timeout for an async spec.
62 */
63declare function fit(expectation: string, assertion?: jasmine.ImplementationCallback, timeout?: number): void;
64
65/**
66 * A temporarily disabled `it`. The spec will report as pending and will not be executed.
67 * @param expectation Textual description of what this spec is checking
68 * @param assertion Function that contains the code of your test. If not provided the test will be pending.
69 * @param timeout Custom timeout for an async spec.
70 */
71declare function xit(expectation: string, assertion?: jasmine.ImplementationCallback, timeout?: number): void;
72
73/**
74 * Mark a spec as pending, expectation results will be ignored.
75 * If you call the function pending anywhere in the spec body, no matter the expectations, the spec will be marked pending.
76 * @param reason Reason the spec is pending.
77 */
78declare function pending(reason?: string): void;
79
80/**
81 * Sets a user-defined property that will be provided to reporters as
82 * part of the properties field of SpecResult.
83 * @since 3.6.0
84 */
85declare function setSpecProperty(key: string, value: unknown): void;
86
87/**
88 * Sets a user-defined property that will be provided to reporters as
89 * part of the properties field of SuiteResult.
90 * @since 3.6.0
91 */
92declare function setSuiteProperty(key: string, value: unknown): void;
93
94/**
95 * Run some shared setup before each of the specs in the describe in which it is called.
96 * @param action Function that contains the code to setup your specs.
97 * @param timeout Custom timeout for an async beforeEach.
98 */
99declare function beforeEach(action: jasmine.ImplementationCallback, timeout?: number): void;
100
101/**
102 * Run some shared teardown after each of the specs in the describe in which it is called.
103 * @param action Function that contains the code to teardown your specs.
104 * @param timeout Custom timeout for an async afterEach.
105 */
106declare function afterEach(action: jasmine.ImplementationCallback, timeout?: number): void;
107
108/**
109 * Run some shared setup once before all of the specs in the describe are run.
110 * Note: Be careful, sharing the setup from a beforeAll makes it easy to accidentally leak state between your specs so that they erroneously pass or fail.
111 * @param action Function that contains the code to setup your specs.
112 * @param timeout Custom timeout for an async beforeAll.
113 */
114declare function beforeAll(action: jasmine.ImplementationCallback, timeout?: number): void;
115
116/**
117 * Run some shared teardown once after all of the specs in the describe are run.
118 * Note: Be careful, sharing the teardown from a afterAll makes it easy to accidentally leak state between your specs so that they erroneously pass or fail.
119 * @param action Function that contains the code to teardown your specs.
120 * @param timeout Custom timeout for an async afterAll
121 */
122declare function afterAll(action: jasmine.ImplementationCallback, timeout?: number): void;
123
124/**
125 * Create an expectation for a spec.
126 * @checkReturnValue see https://tsetse.info/check-return-value
127 * @param spy
128 */
129declare function expect<T extends jasmine.Func>(spy: T | jasmine.Spy<T>): jasmine.FunctionMatchers<T>;
130
131/**
132 * Create an expectation for a spec.
133 * @checkReturnValue see https://tsetse.info/check-return-value
134 * @param actual
135 */
136declare function expect<T>(actual: ArrayLike<T>): jasmine.ArrayLikeMatchers<T>;
137
138/**
139 * Create an expectation for a spec.
140 * @checkReturnValue see https://tsetse.info/check-return-value
141 * @param actual Actual computed value to test expectations against.
142 */
143declare function expect<T>(actual: T): jasmine.Matchers<T>;
144
145/**
146 * Create an expectation for a spec.
147 */
148declare function expect(): jasmine.NothingMatcher;
149
150/**
151 * Create an asynchronous expectation for a spec. Note that the matchers
152 * that are provided by an asynchronous expectation all return promises
153 * which must be either returned from the spec or waited for using `await`
154 * in order for Jasmine to associate them with the correct spec.
155 * @checkReturnValue see https://tsetse.info/check-return-value
156 * @param actual Actual computed value to test expectations against.
157 */
158declare function expectAsync<T, U>(actual: T | PromiseLike<T>): jasmine.AsyncMatchers<T, U>;
159
160/**
161 * Explicitly mark a spec as failed.
162 * @param e Reason for the failure
163 */
164declare function fail(e?: any): void;
165
166/**
167 * Action method that should be called when the async work is complete.
168 */
169interface DoneFn extends Function {
170 (): void;
171
172 /** fails the spec and indicates that it has completed. If the message is an Error, Error.message is used */
173 fail: (message?: Error | string) => void;
174}
175
176/**
177 * Install a spy onto an existing object.
178 * @param object The object upon which to install the `Spy`.
179 * @param method The name of the method to replace with a `Spy`.
180 */
181declare function spyOn<T, K extends keyof T = keyof T>(
182 object: T,
183 method: T[K] extends Function ? K : never,
184): jasmine.Spy<
185 T[K] extends jasmine.Func ? T[K] : T[K] extends { new (...args: infer A): infer V } ? (...args: A) => V : never
186>;
187
188/**
189 * Install a spy on a property installed with `Object.defineProperty` onto an existing object.
190 * @param object The object upon which to install the `Spy`.
191 * @param property The name of the property to replace with a `Spy`.
192 * @param accessType The access type (get|set) of the property to `Spy` on.
193 */
194declare function spyOnProperty<T, K extends keyof T = keyof T>(
195 object: T, property: K, accessType?: "get"): jasmine.Spy<(this: T) => T[K]>;
196declare function spyOnProperty<T, K extends keyof T = keyof T>(
197 object: T, property: K, accessType: "set"): jasmine.Spy<(this: T, value: T[K]) => void>;
198
199/**
200 * Installs spies on all writable and configurable properties of an object.
201 * @param object The object upon which to install the `Spy`s.
202 * @param includeNonEnumerable Whether or not to add spies to non-enumerable properties.
203 */
204declare function spyOnAllFunctions<T>(object: T, includeNonEnumerable?: boolean): jasmine.SpyObj<T>;
205
206declare namespace jasmine {
207 type Func = (...args: any[]) => any;
208
209 // Use trick with prototype to allow abstract classes.
210 // More info: https://stackoverflow.com/a/38642922/2009373
211 type Constructor = Function & { prototype: any };
212
213 type ImplementationCallback = (() => PromiseLike<any>) | (() => void) | ((done: DoneFn) => void);
214
215 type ExpectedRecursive<T> =
216 | T
217 | ObjectContaining<T>
218 | AsymmetricMatcher<any>
219 | {
220 [K in keyof T]: ExpectedRecursive<T[K]> | Any;
221 };
222 type Expected<T> =
223 | T
224 | ObjectContaining<T>
225 | AsymmetricMatcher<any>
226 | Any
227 | Spy
228 | {
229 [K in keyof T]: ExpectedRecursive<T[K]>;
230 };
231 type SpyObjMethodNames<T = undefined> = T extends undefined
232 ? ReadonlyArray<string> | { [methodName: string]: any }
233 : ReadonlyArray<keyof T> | { [P in keyof T]?: T[P] extends Func ? ReturnType<T[P]> : any };
234
235 type SpyObjPropertyNames<T = undefined> = T extends undefined
236 ? ReadonlyArray<string> | { [propertyName: string]: any }
237 : ReadonlyArray<keyof T> | { [P in keyof T]?: T[P] };
238
239 /**
240 * Configuration that can be used when configuring Jasmine via {@link jasmine.Env.configure}
241 */
242 interface Configuration {
243 /**
244 * Whether to randomize spec execution order
245 * @since 3.3.0
246 * @default true
247 */
248 random?: boolean | undefined;
249 /**
250 * Seed to use as the basis of randomization.
251 * Null causes the seed to be determined randomly at the start of execution.
252 * @since 3.3.0
253 * @default null
254 */
255 seed?: number | string | null | undefined;
256 /**
257 * Whether to stop execution of the suite after the first spec failure
258 * @since 3.9.0
259 * @default false
260 */
261 stopOnSpecFailure?: boolean | undefined;
262 /**
263 * Whether to fail the spec if it ran no expectations. By default
264 * a spec that ran no expectations is reported as passed. Setting this
265 * to true will report such spec as a failure.
266 * @since 3.5.0
267 * @default false
268 */
269 failSpecWithNoExpectations?: boolean | undefined;
270 /**
271 * Whether to cause specs to only have one expectation failure.
272 * @since 3.3.0
273 * @default false
274 */
275 stopSpecOnExpectationFailure?: boolean | undefined;
276 /**
277 * Function to use to filter specs
278 * @since 3.3.0
279 * @default A function that always returns true.
280 */
281 specFilter?: SpecFilter | undefined;
282 /**
283 * Whether or not reporters should hide disabled specs from their output.
284 * Currently only supported by Jasmine's HTMLReporter
285 * @since 3.3.0
286 * @default false
287 */
288 hideDisabled?: boolean | undefined;
289 /**
290 * Set to provide a custom promise library that Jasmine will use if it needs
291 * to create a promise. If not set, it will default to whatever global Promise
292 * library is available (if any).
293 * @since 3.5.0
294 * @default undefined
295 */
296 Promise?: typeof Promise | undefined;
297 /**
298 * Clean closures when a suite is done running (done by clearing the stored function reference).
299 * This prevents memory leaks, but you won't be able to run jasmine multiple times.
300 * @since 3.10.0
301 * @default true
302 */
303 autoCleanClosures?: boolean | undefined;
304 }
305
306 /** @deprecated Please use `Configuration` instead of `EnvConfiguration`. */
307 type EnvConfiguration = Configuration;
308
309 function clock(): Clock;
310 /**
311 * @deprecated Private method that may be changed or removed in the future
312 */
313 function DiffBuilder(): DiffBuilder;
314
315 /**
316 * That will succeed if the actual value being compared is an instance of the specified class/constructor.
317 */
318 function any(aclass: Constructor | Symbol): AsymmetricMatcher<any>;
319
320 /**
321 * That will succeed if the actual value being compared is not `null` and not `undefined`.
322 */
323 function anything(): AsymmetricMatcher<any>;
324
325 /**
326 * That will succeed if the actual value being compared is `true` or anything truthy.
327 * @since 3.1.0
328 */
329 function truthy(): AsymmetricMatcher<any>;
330
331 /**
332 * That will succeed if the actual value being compared is `null`, `undefined`, `0`, `false` or anything falsey.
333 * @since 3.1.0
334 */
335 function falsy(): AsymmetricMatcher<any>;
336
337 /**
338 * That will succeed if the actual value being compared is empty.
339 * @since 3.1.0
340 */
341 function empty(): AsymmetricMatcher<any>;
342
343 /**
344 * That will succeed if the actual value being compared is not empty.
345 * @since 3.1.0
346 */
347 function notEmpty(): AsymmetricMatcher<any>;
348
349 function arrayContaining<T>(sample: ArrayLike<T>): ArrayContaining<T>;
350 function arrayWithExactContents<T>(sample: ArrayLike<T>): ArrayContaining<T>;
351 function objectContaining<T>(sample: { [K in keyof T]?: ExpectedRecursive<T[K]> }): ObjectContaining<T>;
352 function mapContaining<K, V>(sample: Map<K, V>): AsymmetricMatcher<Map<K, V>>;
353 function setContaining<T>(sample: Set<T>): AsymmetricMatcher<Set<T>>;
354
355 function setDefaultSpyStrategy<Fn extends Func = Func>(fn?: (and: SpyAnd<Fn>) => void): void;
356 function addSpyStrategy<Fn extends Func = Func>(name: string, factory: Fn): void;
357 function createSpy<Fn extends Func>(name?: string, originalFn?: Fn): Spy<Fn>;
358 function createSpyObj(baseName: string, methodNames: SpyObjMethodNames, propertyNames?: SpyObjPropertyNames): any;
359 function createSpyObj<T>(
360 baseName: string,
361 methodNames: SpyObjMethodNames<T>,
362 propertyNames?: SpyObjPropertyNames<T>,
363 ): SpyObj<T>;
364 function createSpyObj(methodNames: SpyObjMethodNames, propertyNames?: SpyObjPropertyNames): any;
365 function createSpyObj<T>(methodNames: SpyObjMethodNames<T>, propertyNames?: SpyObjPropertyNames<T>): SpyObj<T>;
366
367 function getEnv(): Env;
368 function debugLog(msg: string): void;
369
370 function addCustomEqualityTester(equalityTester: CustomEqualityTester): void;
371
372 /**
373 * Add a custom object formatter for the current scope of specs.
374 * Note: This is only callable from within a beforeEach, it, or beforeAll.
375 * @since 3.6.0
376 * @see https://jasmine.github.io/tutorials/custom_object_formatters
377 */
378 function addCustomObjectFormatter(formatter: CustomObjectFormatter): void;
379
380 function addMatchers(matchers: CustomMatcherFactories): void;
381 function addAsyncMatchers(matchers: CustomAsyncMatcherFactories): void;
382
383 function stringMatching(str: string | RegExp): AsymmetricMatcher<string>;
384
385 function stringContaining(str: string | RegExp): AsymmetricMatcher<string>;
386 /**
387 * @deprecated Private method that may be changed or removed in the future
388 */
389 function formatErrorMsg(domain: string, usage: string): (msg: string) => string;
390
391 interface Any extends AsymmetricMatcher<any> {
392 new (expectedClass: any): any;
393 jasmineToString(prettyPrint: (value: any) => string): string;
394 }
395
396 interface AsymmetricMatcher<TValue> {
397 asymmetricMatch(other: TValue, matchersUtil?: MatchersUtil): boolean;
398 jasmineToString?(prettyPrint: (value: any) => string): string;
399 }
400
401 // taken from TypeScript lib.core.es6.d.ts, applicable to CustomMatchers.contains()
402 interface ArrayLike<T> {
403 length: number;
404 [n: number]: T;
405 }
406
407 interface ArrayContaining<T> extends AsymmetricMatcher<any> {
408 new?(sample: ArrayLike<T>): ArrayLike<T>;
409 jasmineToString(prettyPrint: (value: any) => string): string;
410 }
411
412 interface ObjectContaining<T> extends AsymmetricMatcher<T> {
413 new?(sample: { [K in keyof T]?: any }): { [K in keyof T]?: any };
414
415 jasmineToString?(prettyPrint: (value: any) => string): string;
416 }
417
418 interface Clock {
419 install(): Clock;
420 uninstall(): void;
421 /** Calls to any registered callback are triggered when the clock is ticked forward via the jasmine.clock().tick function, which takes a number of milliseconds. */
422 tick(ms: number): void;
423 mockDate(date?: Date): void;
424 withMock(func: () => void): void;
425 }
426
427 type CustomEqualityTester = (first: any, second: any) => boolean | void;
428
429 type CustomObjectFormatter = (value: unknown) => string | undefined;
430
431 interface CustomMatcher {
432 compare<T>(actual: T, expected: T, ...args: any[]): CustomMatcherResult;
433 compare(actual: any, ...expected: any[]): CustomMatcherResult;
434 negativeCompare?<T>(actual: T, expected: T, ...args: any[]): CustomMatcherResult;
435 negativeCompare?(actual: any, ...expected: any[]): CustomMatcherResult;
436 }
437
438 interface CustomAsyncMatcher {
439 compare<T>(actual: T, expected: T, ...args: any[]): PromiseLike<CustomMatcherResult>;
440 compare(actual: any, ...expected: any[]): PromiseLike<CustomMatcherResult>;
441 negativeCompare?<T>(actual: T, expected: T, ...args: any[]): PromiseLike<CustomMatcherResult>;
442 negativeCompare?(actual: any, ...expected: any[]): PromiseLike<CustomMatcherResult>;
443 }
444
445 type CustomMatcherFactory = (util: MatchersUtil) => CustomMatcher;
446
447 type CustomAsyncMatcherFactory = (util: MatchersUtil) => CustomAsyncMatcher;
448
449 interface CustomMatcherFactories {
450 [name: string]: CustomMatcherFactory;
451 }
452
453 interface CustomAsyncMatcherFactories {
454 [name: string]: CustomAsyncMatcherFactory;
455 }
456
457 interface CustomMatcherResult {
458 pass: boolean;
459 message?: string | undefined;
460 }
461
462 /**
463 * @deprecated Private type that may be changed or removed in the future
464 */
465 interface DiffBuilder {
466 setRoots(actual: any, expected: any): void;
467 recordMismatch(formatter?: (actual: any, expected: any, path?: any, prettyPrinter?: any) => string): void;
468 withPath(pathComponent: string, block: () => void): void;
469 getMessage(): string;
470 }
471
472 interface MatchersUtil {
473 equals(a: any, b: any): boolean;
474 contains<T>(
475 haystack: ArrayLike<T> | string,
476 needle: any
477 ): boolean;
478 /**
479 * @deprecated Private method that may be changed or removed in the future
480 */
481 buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: any[]): string;
482
483 /**
484 * Formats a value for use in matcher failure messages and similar
485 * contexts, taking into account the current set of custom value
486 * formatters.
487 * @since 3.6.0
488 * @param value The value to pretty-print
489 * @return The pretty-printed value
490 */
491 pp(value: any): string;
492 }
493
494 interface Env {
495 addReporter(reporter: CustomReporter): void;
496 allowRespy(allow: boolean): void;
497 clearReporters(): void;
498 configuration(): Configuration;
499 configure(configuration: Configuration): void;
500 execute(runnablesToRun: Suite[] | null | undefined, onComplete: Func): void;
501 /** @async */
502 execute(runnablesToRun?: Suite[]): PromiseLike<JasmineDoneInfo>;
503 provideFallbackReporter(reporter: CustomReporter): void;
504 /**
505 * Sets a user-defined property that will be provided to reporters as
506 * part of the properties field of SpecResult.
507 * @since 3.6.0
508 */
509 setSpecProperty: typeof setSpecProperty;
510 /**
511 * Sets a user-defined property that will be provided to reporters as
512 * part of the properties field of SuiteResult.
513 * @since 3.6.0
514 */
515 setSuiteProperty: typeof setSuiteProperty;
516 topSuite(): Suite;
517 }
518
519 interface HtmlReporter {
520 new (): any;
521 }
522
523 interface HtmlSpecFilter {
524 new (): any;
525 }
526
527 interface Result {
528 type: string;
529 }
530
531 interface ExpectationResult extends Result {
532 matcherName: string;
533 message: string;
534 stack: string;
535 passed: boolean;
536 expected: any;
537 actual: any;
538 }
539
540 interface DeprecationWarning extends Result {
541 message: string;
542 stack: string;
543 }
544
545 interface Order {
546 new (options: { random: boolean; seed: number | string }): any;
547 random: boolean;
548 seed: number | string;
549 sort<T>(items: T[]): T[];
550 }
551
552 namespace errors {
553 class ExpectationFailed extends Error {
554 constructor();
555
556 stack: any;
557 }
558 }
559
560 interface Matchers<T> {
561 /**
562 * Expect the actual value to be `===` to the expected value.
563 *
564 * @param expected The expected value to compare against.
565 * @example
566 * expect(thing).toBe(realThing);
567 */
568 toBe(expected: Expected<T>): void;
569 /**
570 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
571 */
572 // tslint:disable-next-line unified-signatures
573 toBe(expected: Expected<T>, expectationFailOutput: any): void;
574
575 /**
576 * Expect the actual value to be equal to the expected, using deep equality comparison.
577 * @param expected Expected value.
578 * @example
579 * expect(bigObject).toEqual({ "foo": ['bar', 'baz'] });
580 */
581 toEqual(expected: Expected<T>): void;
582 /**
583 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
584 */
585 // tslint:disable-next-line unified-signatures
586 toEqual(expected: Expected<T>, expectationFailOutput: any): void;
587
588 /**
589 * Expect the actual value to match a regular expression.
590 * @param expected Value to look for in the string.
591 * @example
592 * expect("my string").toMatch(/string$/);
593 * expect("other string").toMatch("her");
594 */
595 toMatch(expected: string | RegExp): void;
596 /**
597 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
598 */
599 // tslint:disable-next-line unified-signatures
600 toMatch(expected: string | RegExp, expectationFailOutput: any): void;
601
602 toBeDefined(): void;
603 /**
604 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
605 */
606 // tslint:disable-next-line unified-signatures
607 toBeDefined(expectationFailOutput: any): void;
608 toBeUndefined(): void;
609 /**
610 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
611 */
612 // tslint:disable-next-line unified-signatures
613 toBeUndefined(expectationFailOutput: any): void;
614 toBeNull(): void;
615 /**
616 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
617 */
618 // tslint:disable-next-line unified-signatures
619 toBeNull(expectationFailOutput: any): void;
620 toBeNaN(): void;
621 toBeTruthy(): void;
622 /**
623 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
624 */
625 // tslint:disable-next-line unified-signatures
626 toBeTruthy(expectationFailOutput: any): void;
627 toBeFalsy(): void;
628 /**
629 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
630 */
631 // tslint:disable-next-line unified-signatures
632 toBeFalsy(expectationFailOutput: any): void;
633 toBeTrue(): void;
634 toBeFalse(): void;
635 toHaveBeenCalled(): void;
636 toHaveBeenCalledBefore(expected: Func): void;
637 toHaveBeenCalledWith(...params: any[]): void;
638 toHaveBeenCalledOnceWith(...params: any[]): void;
639 toHaveBeenCalledTimes(expected: number): void;
640 toContain(expected: any): void;
641 /**
642 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
643 */
644 // tslint:disable-next-line unified-signatures
645 toContain(expected: any, expectationFailOutput: any): void;
646 toBeLessThan(expected: number): void;
647 /**
648 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
649 */
650 // tslint:disable-next-line unified-signatures
651 toBeLessThan(expected: number, expectationFailOutput: any): void;
652 toBeLessThanOrEqual(expected: number): void;
653 /**
654 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
655 */
656 // tslint:disable-next-line unified-signatures
657 toBeLessThanOrEqual(expected: number, expectationFailOutput: any): void;
658 toBeGreaterThan(expected: number): void;
659 /**
660 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
661 */
662 // tslint:disable-next-line unified-signatures
663 toBeGreaterThan(expected: number, expectationFailOutput: any): void;
664 toBeGreaterThanOrEqual(expected: number): void;
665 /**
666 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
667 */
668 // tslint:disable-next-line unified-signatures
669 toBeGreaterThanOrEqual(expected: number, expectationFailOutput: any): void;
670 toBeCloseTo(expected: number, precision?: any): void;
671 /**
672 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
673 */
674 // tslint:disable-next-line unified-signatures
675 toBeCloseTo(expected: number, precision: any, expectationFailOutput: any): void;
676 toThrow(expected?: any): void;
677 toThrowError(message?: string | RegExp): void;
678 toThrowError(expected?: new (...args: any[]) => Error, message?: string | RegExp): void;
679 toThrowMatching(predicate: (thrown: any) => boolean): void;
680 toBeNegativeInfinity(): void;
681 /**
682 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
683 */
684 // tslint:disable-next-line unified-signatures
685 toBeNegativeInfinity(expectationFailOutput: any): void;
686 toBePositiveInfinity(): void;
687 /**
688 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
689 */
690 // tslint:disable-next-line unified-signatures
691 toBePositiveInfinity(expectationFailOutput: any): void;
692 toBeInstanceOf(expected: Constructor): void;
693
694 /**
695 * Expect the actual value to be a DOM element that has the expected class.
696 * @since 3.0.0
697 * @param expected The class name to test for.
698 * @example
699 * var el = document.createElement('div');
700 * el.className = 'foo bar baz';
701 * expect(el).toHaveClass('bar');
702 */
703 toHaveClass(expected: string): void;
704 /**
705 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
706 */
707 // tslint:disable-next-line unified-signatures
708 toHaveClass(expected: string, expectationFailOutput: any): void;
709
710 /**
711 * Expect the actual size to be equal to the expected, using array-like
712 * length or object keys size.
713 * @since 3.6.0
714 * @param expected The expected size
715 * @example
716 * array = [1,2];
717 * expect(array).toHaveSize(2);
718 */
719 toHaveSize(expected: number): void;
720
721 /**
722 * {@link expect} the actual (a {@link SpyObj}) spies to have been called.
723 * @since 4.1.0
724 * @example
725 * expect(mySpyObj).toHaveSpyInteractions();
726 * expect(mySpyObj).not.toHaveSpyInteractions();
727 */
728 toHaveSpyInteractions(): void;
729
730 /**
731 * Add some context for an expect.
732 * @param message Additional context to show when the matcher fails
733 * @checkReturnValue see https://tsetse.info/check-return-value
734 */
735 withContext(message: string): Matchers<T>;
736
737 /**
738 * Invert the matcher following this expect.
739 */
740 not: Matchers<T>;
741 }
742
743 interface ArrayLikeMatchers<T> extends Matchers<ArrayLike<T>> {
744 /**
745 * Expect the actual value to be `===` to the expected value.
746 *
747 * @param expected The expected value to compare against.
748 * @example
749 * expect(thing).toBe(realThing);
750 */
751 toBe(expected: Expected<ArrayLike<T>> | ArrayContaining<T>): void;
752 /**
753 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
754 */
755 // tslint:disable-next-line unified-signatures
756 toBe(expected: Expected<ArrayLike<T>> | ArrayContaining<T>, expectationFailOutput: any): void;
757
758 /**
759 * Expect the actual value to be equal to the expected, using deep equality comparison.
760 * @param expected Expected value.
761 * @example
762 * expect(bigObject).toEqual({ "foo": ['bar', 'baz'] });
763 */
764 toEqual(expected: Expected<ArrayLike<T>> | ArrayContaining<T>): void;
765 /**
766 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
767 */
768 // tslint:disable-next-line unified-signatures
769 toEqual(expected: Expected<ArrayLike<T>> | ArrayContaining<T>, expectationFailOutput: any): void;
770
771 toContain(expected: Expected<T>): void;
772 /**
773 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
774 */
775 // tslint:disable-next-line unified-signatures
776 toContain(expected: Expected<T>, expectationFailOutput: any): void;
777
778 /**
779 * Add some context for an expect.
780 * @param message Additional context to show when the matcher fails.
781 * @checkReturnValue see https://tsetse.info/check-return-value
782 */
783 withContext(message: string): ArrayLikeMatchers<T>;
784
785 /**
786 * Invert the matcher following this expect.
787 */
788 not: ArrayLikeMatchers<T>;
789 }
790
791 type MatchableArgs<Fn> = Fn extends (...args: infer P) => any ? { [K in keyof P]: Expected<P[K]> } : never;
792
793 interface FunctionMatchers<Fn extends Func> extends Matchers<any> {
794 /**
795 * Expects the actual (a spy) to have been called with the particular arguments at least once
796 * @param params The arguments to look for
797 */
798 toHaveBeenCalledWith(...params: MatchableArgs<Fn>): void;
799
800 /**
801 * Expects the actual (a spy) to have been called exactly once, and exactly with the particular arguments
802 * @param params The arguments to look for
803 */
804 toHaveBeenCalledOnceWith(...params: MatchableArgs<Fn>): void;
805
806 /**
807 * Add some context for an expect.
808 * @param message Additional context to show when the matcher fails.
809 * @checkReturnValue see https://tsetse.info/check-return-value
810 */
811 withContext(message: string): FunctionMatchers<Fn>;
812
813 /**
814 * Invert the matcher following this expect.
815 */
816 not: FunctionMatchers<Fn>;
817 }
818
819 interface NothingMatcher {
820 nothing(): void;
821 }
822
823 interface AsyncMatchers<T, U> {
824 /**
825 * Expect a promise to be pending, i.e. the promise is neither resolved nor rejected.
826 */
827 toBePending(): PromiseLike<void>;
828 /**
829 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
830 */
831 // tslint:disable-next-line unified-signatures
832 toBePending(expectationFailOutput: any): PromiseLike<void>;
833
834 /**
835 * Expect a promise to be resolved.
836 */
837 toBeResolved(): PromiseLike<void>;
838 /**
839 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
840 */
841 // tslint:disable-next-line unified-signatures
842 toBeResolved(expectationFailOutput: any): PromiseLike<void>;
843
844 /**
845 * Expect a promise to be rejected.
846 */
847 toBeRejected(): PromiseLike<void>;
848 /**
849 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
850 */
851 // tslint:disable-next-line unified-signatures
852 toBeRejected(expectationFailOutput: any): PromiseLike<void>;
853
854 /**
855 * Expect a promise to be resolved to a value equal to the expected, using deep equality comparison.
856 * @param expected Value that the promise is expected to resolve to.
857 */
858 toBeResolvedTo(expected: Expected<T>): PromiseLike<void>;
859
860 /**
861 * Expect a promise to be rejected with a value equal to the expected, using deep equality comparison.
862 * @param expected Value that the promise is expected to be rejected with.
863 */
864 toBeRejectedWith(expected: Expected<U>): PromiseLike<void>;
865
866 /**
867 * Expect a promise to be rejected with a value matched to the expected.
868 * @param expected Error constructor the object that was thrown needs to be an instance of. If not provided, Error will be used.
869 * @param message The message that should be set on the thrown Error.
870 */
871 toBeRejectedWithError(expected?: new (...args: any[]) => Error, message?: string | RegExp): PromiseLike<void>;
872
873 /**
874 * Expect a promise to be rejected with a value matched to the expected.
875 * @param message The message that should be set on the thrown Error.
876 */
877 toBeRejectedWithError(message?: string | RegExp): PromiseLike<void>;
878
879 /**
880 * Add some context for an expect.
881 * @param message Additional context to show when the matcher fails.
882 * @checkReturnValue see https://tsetse.info/check-return-value
883 */
884 withContext(message: string): AsyncMatchers<T, U>;
885
886 /**
887 * Fail as soon as possible if the actual is pending. Otherwise evaluate the matcher.
888 */
889 already: AsyncMatchers<T, U>;
890
891 /**
892 * Invert the matcher following this expect.
893 */
894 not: AsyncMatchers<T, U>;
895 }
896
897 interface JasmineStartedInfo {
898 totalSpecsDefined: number;
899 order: Order;
900 }
901
902 interface CustomReportExpectation {
903 matcherName: string;
904 message: string;
905 passed: boolean;
906 stack: string;
907 }
908
909 interface FailedExpectation extends CustomReportExpectation {
910 actual: string;
911 expected: string;
912 }
913
914 interface PassedExpectation extends CustomReportExpectation {}
915
916 interface DeprecatedExpectation {
917 message: string;
918 }
919
920 interface SuiteResult {
921 /**
922 * The unique id of this spec.
923 */
924 id: string;
925
926 /**
927 * The description passed to the {@link it} that created this spec.
928 */
929 description: string;
930
931 /**
932 * The full description including all ancestors of this spec.
933 */
934 fullName: string;
935
936 /**
937 * The list of expectations that failed during execution of this spec.
938 */
939 failedExpectations: FailedExpectation[];
940
941 /**
942 * The list of deprecation warnings that occurred during execution this spec.
943 */
944 deprecationWarnings: DeprecatedExpectation[];
945
946 /**
947 * Once the spec has completed, this string represents the pass/fail status of this spec.
948 */
949 status: string;
950
951 /**
952 * The time in ms used by the spec execution, including any before/afterEach.
953 */
954 duration: number | null;
955
956 /**
957 * User-supplied properties, if any, that were set using {@link Env.setSpecProperty}
958 */
959 properties: { [key: string]: unknown } | null;
960 }
961
962 interface SpecResult extends SuiteResult {
963 /**
964 * The list of expectations that passed during execution of this spec.
965 */
966 passedExpectations: PassedExpectation[];
967
968 /**
969 * If the spec is pending, this will be the reason.
970 */
971 pendingReason: string;
972
973 debugLogs: DebugLogEntry[] | null;
974 }
975
976 interface DebugLogEntry {
977 message: String;
978 timestamp: number;
979 }
980
981 interface JasmineDoneInfo {
982 overallStatus: string;
983 totalTime: number;
984 incompleteReason: string;
985 order: Order;
986 failedExpectations: ExpectationResult[];
987 deprecationWarnings: ExpectationResult[];
988 }
989
990 /** @deprecated use JasmineStartedInfo instead */
991 type SuiteInfo = JasmineStartedInfo;
992
993 /** @deprecated use SuiteResult or SpecResult instead */
994 type CustomReporterResult = SuiteResult & SpecResult;
995
996 /** @deprecated use JasmineDoneInfo instead */
997 type RunDetails = JasmineDoneInfo;
998
999 interface CustomReporter {
1000 jasmineStarted?(suiteInfo: JasmineStartedInfo, done?: () => void): void | Promise<void>;
1001 suiteStarted?(result: SuiteResult, done?: () => void): void | Promise<void>;
1002 specStarted?(result: SpecResult, done?: () => void): void | Promise<void>;
1003 specDone?(result: SpecResult, done?: () => void): void | Promise<void>;
1004 suiteDone?(result: SuiteResult, done?: () => void): void | Promise<void>;
1005 jasmineDone?(runDetails: JasmineDoneInfo, done?: () => void): void | Promise<void>;
1006 }
1007
1008 interface SpecFilter {
1009 /**
1010 * A function that takes a spec and returns true if it should be executed or false if it should be skipped.
1011 * @param spec The spec that the filter is being applied to
1012 */
1013 (spec: Spec): boolean;
1014 }
1015
1016 /** @deprecated Please use `SpecFilter` instead of `SpecFunction`. */
1017 type SpecFunction = (spec?: Spec) => void;
1018
1019 interface Spec {
1020 new (attrs: any): any;
1021
1022 readonly id: number;
1023 env: Env;
1024 readonly description: string;
1025 getFullName(): string;
1026 }
1027
1028 interface Suite extends Spec {
1029 parentSuite: Suite;
1030 children: Array<Spec | Suite>;
1031 }
1032
1033 interface Spy<Fn extends Func = Func> {
1034 (...params: Parameters<Fn>): ReturnType<Fn>;
1035
1036 and: SpyAnd<Fn>;
1037 calls: Calls<Fn>;
1038 withArgs(...args: MatchableArgs<Fn>): Spy<Fn>;
1039 }
1040
1041 type SpyObj<T> = T &
1042 {
1043 [K in keyof T]: T[K] extends Func ? T[K] & Spy<T[K]> : T[K];
1044 };
1045
1046 /**
1047 * Determines whether the provided function is a Jasmine spy.
1048 * @since 2.0.0
1049 * @param putativeSpy The function to check.
1050 */
1051 function isSpy(putativeSpy: Func): putativeSpy is Spy;
1052
1053 /**
1054 * It's like SpyObj, but doesn't verify argument/return types for functions.
1055 * Useful if TS cannot correctly infer type for complex objects.
1056 */
1057 type NonTypedSpyObj<T> = SpyObj<{ [K in keyof T]: T[K] extends Func ? Func : T[K] }>;
1058
1059 /**
1060 * Obtains the promised type that a promise-returning function resolves to.
1061 */
1062 type PromisedReturnType<Fn extends Func> = Fn extends (...args: any[]) => PromiseLike<infer TResult>
1063 ? TResult
1064 : never;
1065
1066 /**
1067 * Obtains the type that a promise-returning function can be rejected with.
1068 * This is so we can use .and.rejectWith() only for functions that return a promise.
1069 */
1070 type PromisedRejectType<Fn extends Function> = Fn extends (...args: any[]) => PromiseLike<unknown> ? any : never;
1071
1072 interface SpyAnd<Fn extends Func> {
1073 identity: string;
1074
1075 /** By chaining the spy with and.callThrough, the spy will still track all calls to it but in addition it will delegate to the actual implementation. */
1076 callThrough(): Spy<Fn>;
1077 /** By chaining the spy with and.returnValue, all calls to the function will return a specific value. */
1078 returnValue(val: ReturnType<Fn>): Spy<Fn>;
1079 /** By chaining the spy with and.returnValues, all calls to the function will return specific values in order until it reaches the end of the return values list. */
1080 returnValues(...values: Array<ReturnType<Fn>>): Spy<Fn>;
1081 /** By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied function. */
1082 callFake(fn: Fn): Spy<Fn>;
1083 /** Tell the spy to return a promise resolving to the specified value when invoked. */
1084 resolveTo(val?: PromisedReturnType<Fn>): Spy<Fn>;
1085 /** Tell the spy to return a promise rejecting with the specified value when invoked. */
1086 rejectWith(val?: PromisedRejectType<Fn>): Spy<Fn>;
1087 /** By chaining the spy with and.throwError, all calls to the spy will throw the specified value. */
1088 throwError(msg: string | Error): Spy;
1089 /** When a calling strategy is used for a spy, the original stubbing behavior can be returned at any time with and.stub. */
1090 stub(): Spy;
1091 }
1092
1093 interface Calls<Fn extends Func> {
1094 /** By chaining the spy with calls.any(), will return false if the spy has not been called at all, and then true once at least one call happens. */
1095 any(): boolean;
1096 /** By chaining the spy with calls.count(), will return the number of times the spy was called */
1097 count(): number;
1098 /** By chaining the spy with calls.argsFor(), will return the arguments passed to call number index */
1099 argsFor(index: number): Parameters<Fn>;
1100 /** By chaining the spy with calls.allArgs(), will return the arguments to all calls */
1101 allArgs(): ReadonlyArray<Parameters<Fn>>;
1102 /** By chaining the spy with calls.all(), will return the context (the this) and arguments passed all calls */
1103 all(): ReadonlyArray<CallInfo<Fn>>;
1104 /** By chaining the spy with calls.mostRecent(), will return the context (the this) and arguments for the most recent call */
1105 mostRecent(): CallInfo<Fn>;
1106 /** By chaining the spy with calls.first(), will return the context (the this) and arguments for the first call */
1107 first(): CallInfo<Fn>;
1108 /** By chaining the spy with calls.reset(), will clears all tracking for a spy */
1109 reset(): void;
1110 /** Set this spy to do a shallow clone of arguments passed to each invocation. */
1111 saveArgumentsByValue(): void;
1112 /** Get the "this" object that was passed to a specific invocation of this spy. */
1113 thisFor(index: number): ThisType<Fn>;
1114 }
1115
1116 interface CallInfo<Fn extends Func> {
1117 /** The context (the this) for the call */
1118 object: ThisType<Fn>;
1119 /** All arguments passed to the call */
1120 args: Parameters<Fn>;
1121 /** The return value of the call */
1122 returnValue: ReturnType<Fn>;
1123 }
1124
1125 interface Util {
1126 inherit(childClass: Function, parentClass: Function): any;
1127 formatException(e: any): any;
1128 htmlEscape(str: string): string;
1129 argsToArray(args: any): any;
1130 extend(destination: any, source: any): any;
1131 }
1132
1133 interface JsApiReporter extends CustomReporter {
1134 new (): any;
1135
1136 started: boolean;
1137 finished: boolean;
1138 runDetails: JasmineDoneInfo;
1139
1140 status(): string;
1141 suiteResults(index: number, length: number): SuiteResult[];
1142 specResults(index: number, length: number): SpecResult[];
1143 suites(): { [id: string]: SuiteResult };
1144 specs(): SpecResult[];
1145 executionTime(): number;
1146 }
1147
1148 interface Jasmine {
1149 Spec: Spec;
1150 clock: Clock;
1151 util: Util;
1152 }
1153
1154 var HtmlReporter: HtmlReporter;
1155 var HtmlSpecFilter: HtmlSpecFilter;
1156
1157 /**
1158 * Default number of milliseconds Jasmine will wait for an asynchronous spec to complete.
1159 */
1160 var DEFAULT_TIMEOUT_INTERVAL: number;
1161
1162 /**
1163 * Maximum number of array elements to display when pretty printing objects.
1164 * This will also limit the number of keys and values displayed for an object.
1165 * Elements past this number will be ellipised.
1166 */
1167 var MAX_PRETTY_PRINT_ARRAY_LENGTH: number;
1168
1169 /**
1170 * Maximum number of characters to display when pretty printing objects.
1171 * Characters past this number will be ellipised.
1172 */
1173 var MAX_PRETTY_PRINT_CHARS: number;
1174
1175 /**
1176 * Maximum object depth the pretty printer will print to.
1177 * Set this to a lower value to speed up pretty printing if you have large objects.
1178 */
1179 var MAX_PRETTY_PRINT_DEPTH: number;
1180
1181 var version: string;
1182
1183 interface JasmineOptions {
1184 /**
1185 * The path to the project's base directory. This can be absolute or relative
1186 * to the current working directory. If it isn't specified, the current working
1187 * directory will be used.
1188 */
1189 projectBaseDir?: string;
1190 }
1191
1192 interface JasmineConfig {
1193 /**
1194 * Whether to fail specs that contain no expectations.
1195 * @default false
1196 */
1197 failSpecWithNoExpectations?: boolean;
1198 /**
1199 * An array of helper file paths or globs that match helper files. Each path or
1200 * glob will be evaluated relative to the spec directory. Helpers are loaded before specs.
1201 */
1202 helpers?: string[];
1203 /**
1204 * Specifies how to load files with names ending in .js. Valid values are
1205 * "require" and "import". "import" should be safe in all cases, and is
1206 * required if your project contains ES modules with filenames ending in .js.
1207 * @default "require"
1208 */
1209 jsLoader?: "require" | "import";
1210 /**
1211 * Whether to run specs in a random order.
1212 */
1213 random?: boolean;
1214 /**
1215 * An array of module names to load via require() at the start of execution.
1216 */
1217 requires?: string[];
1218 /**
1219 * The directory that spec files are contained in, relative to the project base directory.
1220 */
1221 spec_dir?: string;
1222 /**
1223 * An array of spec file paths or globs that match helper files. Each path
1224 * or glob will be evaluated relative to the spec directory.
1225 */
1226 spec_files?: string[];
1227 /**
1228 * Whether to stop suite execution on the first spec failure.
1229 */
1230 stopOnSpecFailure?: boolean;
1231 /**
1232 * Whether to stop each spec on the first expectation failure.
1233 */
1234 stopSpecOnExpectationFailure?: boolean;
1235 }
1236
1237 interface DefaultReporterOptions {
1238 timer?: any;
1239 print?: (...args: any[]) => void;
1240 showColors?: boolean;
1241 jasmineCorePath?: string;
1242 }
1243}
1244
1245declare module "jasmine" {
1246 class jasmine {
1247 jasmine: jasmine.Jasmine;
1248 env: jasmine.Env;
1249 /**
1250 * @deprecated Private property that may be changed or removed in the future
1251 */
1252 reportersCount: number;
1253 /**
1254 * @deprecated Private property that may be changed or removed in the future
1255 */
1256 reporter: jasmine.CustomReporter;
1257 /**
1258 * @deprecated Private property that may be changed or removed in the future
1259 */
1260 showingColors: boolean;
1261 /**
1262 * @deprecated Private property that may be changed or removed in the future
1263 */
1264 projectBaseDir: string;
1265 /**
1266 * @deprecated Private property that may be changed or removed in the future
1267 */
1268 specDir: string;
1269 /**
1270 * @deprecated Private property that may be changed or removed in the future
1271 */
1272 specFiles: string[];
1273 /**
1274 * @deprecated Private property that may be changed or removed in the future
1275 */
1276 helperFiles: string[];
1277 /**
1278 * @deprecated Private property that may be changed or removed in the future
1279 */
1280 requires: string[];
1281 /**
1282 * @deprecated Private property that may be changed or removed in the future
1283 */
1284 defaultReporterConfigured: boolean;
1285
1286 constructor(options?: jasmine.JasmineOptions);
1287 addMatchers(matchers: jasmine.CustomMatcherFactories): void;
1288 /**
1289 * Add a custom reporter to the Jasmine environment.
1290 */
1291 addReporter(reporter: jasmine.CustomReporter): void;
1292 /**
1293 * Adds a spec file to the list that will be loaded when the suite is executed.
1294 */
1295 addSpecFile(filePath: string): void;
1296 addMatchingSpecFiles(patterns: string[]): void;
1297 addHelperFile(filePath: string): void;
1298 addMatchingHelperFiles(patterns: string[]): void;
1299 /**
1300 * @deprecated Private method that may be changed or removed in the future
1301 */
1302 addRequires(files: string[]): void;
1303 /**
1304 * Configure the default reporter.
1305 */
1306 configureDefaultReporter(options: jasmine.DefaultReporterOptions): void;
1307 execute(files?: string[], filterString?: string): Promise<jasmine.JasmineDoneInfo>;
1308 exitOnCompletion: boolean;
1309 loadConfig(config: jasmine.JasmineConfig): void;
1310 loadConfigFile(configFilePath?: string): void;
1311 /**
1312 * @deprecated Private method that may be changed or removed in the future
1313 */
1314 loadHelpers(): Promise<void>;
1315 /**
1316 * @deprecated Private method that may be changed or removed in the future
1317 */
1318 loadSpecs(): Promise<void>;
1319 /**
1320 * @deprecated Private method that may be changed or removed in the future
1321 */
1322 loadRequires(): void;
1323
1324 /**
1325 * Provide a fallback reporter if no other reporters have been specified.
1326 */
1327 provideFallbackReporter(reporter: jasmine.CustomReporter): void;
1328 /**
1329 * Clears all registered reporters.
1330 */
1331 clearReporters(): void;
1332 /**
1333 * Sets whether to randomize the order of specs.
1334 */
1335 randomizeTests(value: boolean): void;
1336 /**
1337 * Sets the random seed.
1338 */
1339 seed(value: number): void;
1340 /**
1341 * Sets whether to show colors in the console reporter.
1342 */
1343 showColors(value: boolean): void;
1344 stopSpecOnExpectationFailure(value: boolean): void;
1345 stopOnSpecFailure(value: boolean): void;
1346 static ConsoleReporter(): any;
1347
1348 /**
1349 * The version of jasmine-core in use
1350 */
1351 coreVersion(): string;
1352 }
1353 export = jasmine;
1354}