UNPKG

51.6 kBTypeScriptView Raw
1// Type definitions for Jasmine 4.3
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 spyOnGlobalErrorsAsync(fn?: (globalErrorSpy: Error) => Promise<void>): Promise<void>;
357 function addSpyStrategy<Fn extends Func = Func>(name: string, factory: Fn): void;
358 function createSpy<Fn extends Func>(name?: string, originalFn?: Fn): Spy<Fn>;
359 function createSpyObj(baseName: string, methodNames: SpyObjMethodNames, propertyNames?: SpyObjPropertyNames): any;
360 function createSpyObj<T>(
361 baseName: string,
362 methodNames: SpyObjMethodNames<T>,
363 propertyNames?: SpyObjPropertyNames<T>,
364 ): SpyObj<T>;
365 function createSpyObj(methodNames: SpyObjMethodNames, propertyNames?: SpyObjPropertyNames): any;
366 function createSpyObj<T>(methodNames: SpyObjMethodNames<T>, propertyNames?: SpyObjPropertyNames<T>): SpyObj<T>;
367
368 function getEnv(): Env;
369 function debugLog(msg: string): void;
370
371 function addCustomEqualityTester(equalityTester: CustomEqualityTester): void;
372
373 /**
374 * Add a custom object formatter for the current scope of specs.
375 * Note: This is only callable from within a beforeEach, it, or beforeAll.
376 * @since 3.6.0
377 * @see https://jasmine.github.io/tutorials/custom_object_formatters
378 */
379 function addCustomObjectFormatter(formatter: CustomObjectFormatter): void;
380
381 function addMatchers(matchers: CustomMatcherFactories): void;
382 function addAsyncMatchers(matchers: CustomAsyncMatcherFactories): void;
383
384 function stringMatching(str: string | RegExp): AsymmetricMatcher<string>;
385
386 function stringContaining(str: string | RegExp): AsymmetricMatcher<string>;
387 /**
388 * @deprecated Private method that may be changed or removed in the future
389 */
390 function formatErrorMsg(domain: string, usage: string): (msg: string) => string;
391
392 interface Any extends AsymmetricMatcher<any> {
393 new (expectedClass: any): any;
394 jasmineToString(prettyPrint: (value: any) => string): string;
395 }
396
397 interface AsymmetricMatcher<TValue> {
398 asymmetricMatch(other: TValue, matchersUtil?: MatchersUtil): boolean;
399 jasmineToString?(prettyPrint: (value: any) => string): string;
400 }
401
402 // taken from TypeScript lib.core.es6.d.ts, applicable to CustomMatchers.contains()
403 interface ArrayLike<T> {
404 length: number;
405 [n: number]: T;
406 }
407
408 interface ArrayContaining<T> extends AsymmetricMatcher<any> {
409 new?(sample: ArrayLike<T>): ArrayLike<T>;
410 jasmineToString(prettyPrint: (value: any) => string): string;
411 }
412
413 interface ObjectContaining<T> extends AsymmetricMatcher<T> {
414 new?(sample: { [K in keyof T]?: any }): { [K in keyof T]?: any };
415
416 jasmineToString?(prettyPrint: (value: any) => string): string;
417 }
418
419 interface Clock {
420 install(): Clock;
421 uninstall(): void;
422 /** 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. */
423 tick(ms: number): void;
424 mockDate(date?: Date): void;
425 withMock(func: () => void): void;
426 }
427
428 type CustomEqualityTester = (first: any, second: any) => boolean | void;
429
430 type CustomObjectFormatter = (value: unknown) => string | undefined;
431
432 interface CustomMatcher {
433 compare<T>(actual: T, expected: T, ...args: any[]): CustomMatcherResult;
434 compare(actual: any, ...expected: any[]): CustomMatcherResult;
435 negativeCompare?<T>(actual: T, expected: T, ...args: any[]): CustomMatcherResult;
436 negativeCompare?(actual: any, ...expected: any[]): CustomMatcherResult;
437 }
438
439 interface CustomAsyncMatcher {
440 compare<T>(actual: T, expected: T, ...args: any[]): PromiseLike<CustomMatcherResult>;
441 compare(actual: any, ...expected: any[]): PromiseLike<CustomMatcherResult>;
442 negativeCompare?<T>(actual: T, expected: T, ...args: any[]): PromiseLike<CustomMatcherResult>;
443 negativeCompare?(actual: any, ...expected: any[]): PromiseLike<CustomMatcherResult>;
444 }
445
446 type CustomMatcherFactory = (util: MatchersUtil) => CustomMatcher;
447
448 type CustomAsyncMatcherFactory = (util: MatchersUtil) => CustomAsyncMatcher;
449
450 interface CustomMatcherFactories {
451 [name: string]: CustomMatcherFactory;
452 }
453
454 interface CustomAsyncMatcherFactories {
455 [name: string]: CustomAsyncMatcherFactory;
456 }
457
458 interface CustomMatcherResult {
459 pass: boolean;
460 message?: string | undefined;
461 }
462
463 /**
464 * @deprecated Private type that may be changed or removed in the future
465 */
466 interface DiffBuilder {
467 setRoots(actual: any, expected: any): void;
468 recordMismatch(formatter?: (actual: any, expected: any, path?: any, prettyPrinter?: any) => string): void;
469 withPath(pathComponent: string, block: () => void): void;
470 getMessage(): string;
471 }
472
473 interface MatchersUtil {
474 equals(a: any, b: any): boolean;
475 contains<T>(
476 haystack: ArrayLike<T> | string,
477 needle: any
478 ): boolean;
479 /**
480 * @deprecated Private method that may be changed or removed in the future
481 */
482 buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: any[]): string;
483
484 /**
485 * Formats a value for use in matcher failure messages and similar
486 * contexts, taking into account the current set of custom value
487 * formatters.
488 * @since 3.6.0
489 * @param value The value to pretty-print
490 * @return The pretty-printed value
491 */
492 pp(value: any): string;
493 }
494
495 interface Env {
496 addReporter(reporter: CustomReporter): void;
497 allowRespy(allow: boolean): void;
498 clearReporters(): void;
499 configuration(): Configuration;
500 configure(configuration: Configuration): void;
501 execute(runnablesToRun: Suite[] | null | undefined, onComplete: Func): void;
502 /** @async */
503 execute(runnablesToRun?: Suite[]): PromiseLike<JasmineDoneInfo>;
504 provideFallbackReporter(reporter: CustomReporter): void;
505 /**
506 * Sets a user-defined property that will be provided to reporters as
507 * part of the properties field of SpecResult.
508 * @since 3.6.0
509 */
510 setSpecProperty: typeof setSpecProperty;
511 /**
512 * Sets a user-defined property that will be provided to reporters as
513 * part of the properties field of SuiteResult.
514 * @since 3.6.0
515 */
516 setSuiteProperty: typeof setSuiteProperty;
517 topSuite(): Suite;
518 }
519
520 interface HtmlReporter {
521 new (): any;
522 }
523
524 interface HtmlSpecFilter {
525 new (): any;
526 }
527
528 interface Result {
529 type: string;
530 }
531
532 interface ExpectationResult extends Result {
533 matcherName: string;
534 message: string;
535 stack: string;
536 passed: boolean;
537 expected: any;
538 actual: any;
539 }
540
541 interface DeprecationWarning extends Result {
542 message: string;
543 stack: string;
544 }
545
546 interface Order {
547 new (options: { random: boolean; seed: number | string }): any;
548 random: boolean;
549 seed: number | string;
550 sort<T>(items: T[]): T[];
551 }
552
553 namespace errors {
554 class ExpectationFailed extends Error {
555 constructor();
556
557 stack: any;
558 }
559 }
560
561 interface Matchers<T> {
562 /**
563 * Expect the actual value to be `===` to the expected value.
564 *
565 * @param expected The expected value to compare against.
566 * @example
567 * expect(thing).toBe(realThing);
568 */
569 toBe(expected: Expected<T>): void;
570 /**
571 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
572 */
573 // tslint:disable-next-line unified-signatures
574 toBe(expected: Expected<T>, expectationFailOutput: any): void;
575
576 /**
577 * Expect the actual value to be equal to the expected, using deep equality comparison.
578 * @param expected Expected value.
579 * @example
580 * expect(bigObject).toEqual({ "foo": ['bar', 'baz'] });
581 */
582 toEqual(expected: Expected<T>): void;
583 /**
584 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
585 */
586 // tslint:disable-next-line unified-signatures
587 toEqual(expected: Expected<T>, expectationFailOutput: any): void;
588
589 /**
590 * Expect the actual value to match a regular expression.
591 * @param expected Value to look for in the string.
592 * @example
593 * expect("my string").toMatch(/string$/);
594 * expect("other string").toMatch("her");
595 */
596 toMatch(expected: string | RegExp): void;
597 /**
598 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
599 */
600 // tslint:disable-next-line unified-signatures
601 toMatch(expected: string | RegExp, expectationFailOutput: any): void;
602
603 toBeDefined(): void;
604 /**
605 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
606 */
607 // tslint:disable-next-line unified-signatures
608 toBeDefined(expectationFailOutput: any): void;
609 toBeUndefined(): void;
610 /**
611 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
612 */
613 // tslint:disable-next-line unified-signatures
614 toBeUndefined(expectationFailOutput: any): void;
615 toBeNull(): void;
616 /**
617 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
618 */
619 // tslint:disable-next-line unified-signatures
620 toBeNull(expectationFailOutput: any): void;
621 toBeNaN(): void;
622 toBeTruthy(): void;
623 /**
624 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
625 */
626 // tslint:disable-next-line unified-signatures
627 toBeTruthy(expectationFailOutput: any): void;
628 toBeFalsy(): void;
629 /**
630 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
631 */
632 // tslint:disable-next-line unified-signatures
633 toBeFalsy(expectationFailOutput: any): void;
634 toBeTrue(): void;
635 toBeFalse(): void;
636 toHaveBeenCalled(): void;
637 toHaveBeenCalledBefore(expected: Func): void;
638 toHaveBeenCalledWith(...params: any[]): void;
639 toHaveBeenCalledOnceWith(...params: any[]): void;
640 toHaveBeenCalledTimes(expected: number): void;
641 toContain(expected: any): void;
642 /**
643 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
644 */
645 // tslint:disable-next-line unified-signatures
646 toContain(expected: any, expectationFailOutput: any): void;
647 toBeLessThan(expected: number): void;
648 /**
649 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
650 */
651 // tslint:disable-next-line unified-signatures
652 toBeLessThan(expected: number, expectationFailOutput: any): void;
653 toBeLessThanOrEqual(expected: number): void;
654 /**
655 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
656 */
657 // tslint:disable-next-line unified-signatures
658 toBeLessThanOrEqual(expected: number, expectationFailOutput: any): void;
659 toBeGreaterThan(expected: number): void;
660 /**
661 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
662 */
663 // tslint:disable-next-line unified-signatures
664 toBeGreaterThan(expected: number, expectationFailOutput: any): void;
665 toBeGreaterThanOrEqual(expected: number): void;
666 /**
667 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
668 */
669 // tslint:disable-next-line unified-signatures
670 toBeGreaterThanOrEqual(expected: number, expectationFailOutput: any): void;
671 toBeCloseTo(expected: number, precision?: any): void;
672 /**
673 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
674 */
675 // tslint:disable-next-line unified-signatures
676 toBeCloseTo(expected: number, precision: any, expectationFailOutput: any): void;
677 toThrow(expected?: any): void;
678 toThrowError(message?: string | RegExp): void;
679 toThrowError(expected?: new (...args: any[]) => Error, message?: string | RegExp): void;
680 toThrowMatching(predicate: (thrown: any) => boolean): void;
681 toBeNegativeInfinity(): void;
682 /**
683 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
684 */
685 // tslint:disable-next-line unified-signatures
686 toBeNegativeInfinity(expectationFailOutput: any): void;
687 toBePositiveInfinity(): void;
688 /**
689 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
690 */
691 // tslint:disable-next-line unified-signatures
692 toBePositiveInfinity(expectationFailOutput: any): void;
693 toBeInstanceOf(expected: Constructor): void;
694
695 /**
696 * Expect the actual value to be a DOM element that has the expected class.
697 * @since 3.0.0
698 * @param expected The class name to test for.
699 * @example
700 * var el = document.createElement('div');
701 * el.className = 'foo bar baz';
702 * expect(el).toHaveClass('bar');
703 */
704 toHaveClass(expected: string): void;
705 /**
706 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
707 */
708 // tslint:disable-next-line unified-signatures
709 toHaveClass(expected: string, expectationFailOutput: any): void;
710
711 /**
712 * Expect the actual size to be equal to the expected, using array-like
713 * length or object keys size.
714 * @since 3.6.0
715 * @param expected The expected size
716 * @example
717 * array = [1,2];
718 * expect(array).toHaveSize(2);
719 */
720 toHaveSize(expected: number): void;
721
722 /**
723 * {@link expect} the actual (a {@link SpyObj}) spies to have been called.
724 * @since 4.1.0
725 * @example
726 * expect(mySpyObj).toHaveSpyInteractions();
727 * expect(mySpyObj).not.toHaveSpyInteractions();
728 */
729 toHaveSpyInteractions(): void;
730
731 /**
732 * Add some context for an expect.
733 * @param message Additional context to show when the matcher fails
734 * @checkReturnValue see https://tsetse.info/check-return-value
735 */
736 withContext(message: string): Matchers<T>;
737
738 /**
739 * Invert the matcher following this expect.
740 */
741 not: Matchers<T>;
742 }
743
744 interface ArrayLikeMatchers<T> extends Matchers<ArrayLike<T>> {
745 /**
746 * Expect the actual value to be `===` to the expected value.
747 *
748 * @param expected The expected value to compare against.
749 * @example
750 * expect(thing).toBe(realThing);
751 */
752 toBe(expected: Expected<ArrayLike<T>> | ArrayContaining<T>): void;
753 /**
754 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
755 */
756 // tslint:disable-next-line unified-signatures
757 toBe(expected: Expected<ArrayLike<T>> | ArrayContaining<T>, expectationFailOutput: any): void;
758
759 /**
760 * Expect the actual value to be equal to the expected, using deep equality comparison.
761 * @param expected Expected value.
762 * @example
763 * expect(bigObject).toEqual({ "foo": ['bar', 'baz'] });
764 */
765 toEqual(expected: Expected<ArrayLike<T>> | ArrayContaining<T>): void;
766 /**
767 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
768 */
769 // tslint:disable-next-line unified-signatures
770 toEqual(expected: Expected<ArrayLike<T>> | ArrayContaining<T>, expectationFailOutput: any): void;
771
772 toContain(expected: Expected<T>): void;
773 /**
774 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
775 */
776 // tslint:disable-next-line unified-signatures
777 toContain(expected: Expected<T>, expectationFailOutput: any): void;
778
779 /**
780 * Add some context for an expect.
781 * @param message Additional context to show when the matcher fails.
782 * @checkReturnValue see https://tsetse.info/check-return-value
783 */
784 withContext(message: string): ArrayLikeMatchers<T>;
785
786 /**
787 * Invert the matcher following this expect.
788 */
789 not: ArrayLikeMatchers<T>;
790 }
791
792 type MatchableArgs<Fn> = Fn extends (...args: infer P) => any ? { [K in keyof P]: Expected<P[K]> } : never;
793
794 interface FunctionMatchers<Fn extends Func> extends Matchers<any> {
795 /**
796 * Expects the actual (a spy) to have been called with the particular arguments at least once
797 * @param params The arguments to look for
798 */
799 toHaveBeenCalledWith(...params: MatchableArgs<Fn>): void;
800
801 /**
802 * Expects the actual (a spy) to have been called exactly once, and exactly with the particular arguments
803 * @param params The arguments to look for
804 */
805 toHaveBeenCalledOnceWith(...params: MatchableArgs<Fn>): void;
806
807 /**
808 * Add some context for an expect.
809 * @param message Additional context to show when the matcher fails.
810 * @checkReturnValue see https://tsetse.info/check-return-value
811 */
812 withContext(message: string): FunctionMatchers<Fn>;
813
814 /**
815 * Invert the matcher following this expect.
816 */
817 not: FunctionMatchers<Fn>;
818 }
819
820 interface NothingMatcher {
821 nothing(): void;
822 }
823
824 interface AsyncMatchers<T, U> {
825 /**
826 * Expect a promise to be pending, i.e. the promise is neither resolved nor rejected.
827 */
828 toBePending(): PromiseLike<void>;
829 /**
830 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
831 */
832 // tslint:disable-next-line unified-signatures
833 toBePending(expectationFailOutput: any): PromiseLike<void>;
834
835 /**
836 * Expect a promise to be resolved.
837 */
838 toBeResolved(): PromiseLike<void>;
839 /**
840 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
841 */
842 // tslint:disable-next-line unified-signatures
843 toBeResolved(expectationFailOutput: any): PromiseLike<void>;
844
845 /**
846 * Expect a promise to be rejected.
847 */
848 toBeRejected(): PromiseLike<void>;
849 /**
850 * @deprecated expectationFailOutput is deprecated. Use withContext instead.
851 */
852 // tslint:disable-next-line unified-signatures
853 toBeRejected(expectationFailOutput: any): PromiseLike<void>;
854
855 /**
856 * Expect a promise to be resolved to a value equal to the expected, using deep equality comparison.
857 * @param expected Value that the promise is expected to resolve to.
858 */
859 toBeResolvedTo(expected: Expected<T>): PromiseLike<void>;
860
861 /**
862 * Expect a promise to be rejected with a value equal to the expected, using deep equality comparison.
863 * @param expected Value that the promise is expected to be rejected with.
864 */
865 toBeRejectedWith(expected: Expected<U>): PromiseLike<void>;
866
867 /**
868 * Expect a promise to be rejected with a value matched to the expected.
869 * @param expected Error constructor the object that was thrown needs to be an instance of. If not provided, Error will be used.
870 * @param message The message that should be set on the thrown Error.
871 */
872 toBeRejectedWithError(expected?: new (...args: any[]) => Error, message?: string | RegExp): PromiseLike<void>;
873
874 /**
875 * Expect a promise to be rejected with a value matched to the expected.
876 * @param message The message that should be set on the thrown Error.
877 */
878 toBeRejectedWithError(message?: string | RegExp): PromiseLike<void>;
879
880 /**
881 * Add some context for an expect.
882 * @param message Additional context to show when the matcher fails.
883 * @checkReturnValue see https://tsetse.info/check-return-value
884 */
885 withContext(message: string): AsyncMatchers<T, U>;
886
887 /**
888 * Fail as soon as possible if the actual is pending. Otherwise evaluate the matcher.
889 */
890 already: AsyncMatchers<T, U>;
891
892 /**
893 * Invert the matcher following this expect.
894 */
895 not: AsyncMatchers<T, U>;
896 }
897
898 interface JasmineStartedInfo {
899 totalSpecsDefined: number;
900 order: Order;
901 }
902
903 interface CustomReportExpectation {
904 matcherName: string;
905 message: string;
906 passed: boolean;
907 stack: string;
908 }
909
910 interface FailedExpectation extends CustomReportExpectation {
911 actual: string;
912 expected: string;
913 }
914
915 interface PassedExpectation extends CustomReportExpectation {}
916
917 interface DeprecatedExpectation {
918 message: string;
919 }
920
921 interface SuiteResult {
922 /**
923 * The unique id of this spec.
924 */
925 id: string;
926
927 /**
928 * The description passed to the {@link it} that created this spec.
929 */
930 description: string;
931
932 /**
933 * The full description including all ancestors of this spec.
934 */
935 fullName: string;
936
937 /**
938 * The list of expectations that failed during execution of this spec.
939 */
940 failedExpectations: FailedExpectation[];
941
942 /**
943 * The list of deprecation warnings that occurred during execution this spec.
944 */
945 deprecationWarnings: DeprecatedExpectation[];
946
947 /**
948 * Once the spec has completed, this string represents the pass/fail status of this spec.
949 */
950 status: string;
951
952 /**
953 * The time in ms used by the spec execution, including any before/afterEach.
954 */
955 duration: number | null;
956
957 /**
958 * User-supplied properties, if any, that were set using {@link Env.setSpecProperty}
959 */
960 properties: { [key: string]: unknown } | null;
961 }
962
963 interface SpecResult extends SuiteResult {
964 /**
965 * The list of expectations that passed during execution of this spec.
966 */
967 passedExpectations: PassedExpectation[];
968
969 /**
970 * If the spec is pending, this will be the reason.
971 */
972 pendingReason: string;
973
974 debugLogs: DebugLogEntry[] | null;
975 }
976
977 interface DebugLogEntry {
978 message: String;
979 timestamp: number;
980 }
981
982 interface JasmineDoneInfo {
983 overallStatus: string;
984 totalTime: number;
985 incompleteReason: string;
986 order: Order;
987 failedExpectations: ExpectationResult[];
988 deprecationWarnings: ExpectationResult[];
989 }
990
991 /** @deprecated use JasmineStartedInfo instead */
992 type SuiteInfo = JasmineStartedInfo;
993
994 /** @deprecated use SuiteResult or SpecResult instead */
995 type CustomReporterResult = SuiteResult & SpecResult;
996
997 /** @deprecated use JasmineDoneInfo instead */
998 type RunDetails = JasmineDoneInfo;
999
1000 interface CustomReporter {
1001 jasmineStarted?(suiteInfo: JasmineStartedInfo, done?: () => void): void | Promise<void>;
1002 suiteStarted?(result: SuiteResult, done?: () => void): void | Promise<void>;
1003 specStarted?(result: SpecResult, done?: () => void): void | Promise<void>;
1004 specDone?(result: SpecResult, done?: () => void): void | Promise<void>;
1005 suiteDone?(result: SuiteResult, done?: () => void): void | Promise<void>;
1006 jasmineDone?(runDetails: JasmineDoneInfo, done?: () => void): void | Promise<void>;
1007 }
1008
1009 interface SpecFilter {
1010 /**
1011 * A function that takes a spec and returns true if it should be executed or false if it should be skipped.
1012 * @param spec The spec that the filter is being applied to
1013 */
1014 (spec: Spec): boolean;
1015 }
1016
1017 /** @deprecated Please use `SpecFilter` instead of `SpecFunction`. */
1018 type SpecFunction = (spec?: Spec) => void;
1019
1020 interface Spec {
1021 new (attrs: any): any;
1022
1023 readonly id: number;
1024 env: Env;
1025 readonly description: string;
1026 getFullName(): string;
1027 }
1028
1029 interface Suite extends Spec {
1030 parentSuite: Suite;
1031 children: Array<Spec | Suite>;
1032 }
1033
1034 interface Spy<Fn extends Func = Func> {
1035 (...params: Parameters<Fn>): ReturnType<Fn>;
1036
1037 and: SpyAnd<Fn>;
1038 calls: Calls<Fn>;
1039 withArgs(...args: MatchableArgs<Fn>): Spy<Fn>;
1040 }
1041
1042 type SpyObj<T> = T &
1043 {
1044 [K in keyof T]: T[K] extends Func ? T[K] & Spy<T[K]> : T[K];
1045 };
1046
1047 /**
1048 * Determines whether the provided function is a Jasmine spy.
1049 * @since 2.0.0
1050 * @param putativeSpy The function to check.
1051 */
1052 function isSpy(putativeSpy: Func): putativeSpy is Spy;
1053
1054 /**
1055 * It's like SpyObj, but doesn't verify argument/return types for functions.
1056 * Useful if TS cannot correctly infer type for complex objects.
1057 */
1058 type NonTypedSpyObj<T> = SpyObj<{ [K in keyof T]: T[K] extends Func ? Func : T[K] }>;
1059
1060 /**
1061 * Obtains the promised type that a promise-returning function resolves to.
1062 */
1063 type PromisedResolveType<T> = T extends PromiseLike<infer TResult> ? TResult : never;
1064
1065 /**
1066 * Obtains the type that a promise-returning function can be rejected with.
1067 * This is so we can use .and.rejectWith() only for functions that return a promise.
1068 */
1069 type PromisedRejectType<T> = T extends PromiseLike<unknown> ? any : never;
1070
1071 interface SpyAnd<Fn extends Func> {
1072 identity: string;
1073
1074 /** 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. */
1075 callThrough(): Spy<Fn>;
1076 /** By chaining the spy with and.returnValue, all calls to the function will return a specific value. */
1077 returnValue(val: ReturnType<Fn>): Spy<Fn>;
1078 /** 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. */
1079 returnValues(...values: Array<ReturnType<Fn>>): Spy<Fn>;
1080 /** By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied function. */
1081 callFake(fn: Fn): Spy<Fn>;
1082 /** Tell the spy to return a promise resolving to the specified value when invoked. */
1083 resolveTo(val?: PromisedResolveType<ReturnType<Fn>>): Spy<Fn>;
1084 /** Tell the spy to return a promise rejecting with the specified value when invoked. */
1085 rejectWith(val?: PromisedRejectType<ReturnType<Fn>>): Spy<Fn>;
1086 /** By chaining the spy with and.throwError, all calls to the spy will throw the specified value. */
1087 throwError(msg: string | Error): Spy;
1088 /** When a calling strategy is used for a spy, the original stubbing behavior can be returned at any time with and.stub. */
1089 stub(): Spy;
1090 }
1091
1092 interface Calls<Fn extends Func> {
1093 /** 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. */
1094 any(): boolean;
1095 /** By chaining the spy with calls.count(), will return the number of times the spy was called */
1096 count(): number;
1097 /** By chaining the spy with calls.argsFor(), will return the arguments passed to call number index */
1098 argsFor(index: number): Parameters<Fn>;
1099 /** By chaining the spy with calls.allArgs(), will return the arguments to all calls */
1100 allArgs(): ReadonlyArray<Parameters<Fn>>;
1101 /** By chaining the spy with calls.all(), will return the context (the this) and arguments passed all calls */
1102 all(): ReadonlyArray<CallInfo<Fn>>;
1103 /** By chaining the spy with calls.mostRecent(), will return the context (the this) and arguments for the most recent call */
1104 mostRecent(): CallInfo<Fn>;
1105 /** By chaining the spy with calls.first(), will return the context (the this) and arguments for the first call */
1106 first(): CallInfo<Fn>;
1107 /** By chaining the spy with calls.reset(), will clears all tracking for a spy */
1108 reset(): void;
1109 /** Set this spy to do a shallow clone of arguments passed to each invocation. */
1110 saveArgumentsByValue(): void;
1111 /** Get the "this" object that was passed to a specific invocation of this spy. */
1112 thisFor(index: number): ThisType<Fn>;
1113 }
1114
1115 interface CallInfo<Fn extends Func> {
1116 /** The context (the this) for the call */
1117 object: ThisType<Fn>;
1118 /** All arguments passed to the call */
1119 args: Parameters<Fn>;
1120 /** The return value of the call */
1121 returnValue: ReturnType<Fn>;
1122 }
1123
1124 interface Util {
1125 inherit(childClass: Function, parentClass: Function): any;
1126 formatException(e: any): any;
1127 htmlEscape(str: string): string;
1128 argsToArray(args: any): any;
1129 extend(destination: any, source: any): any;
1130 }
1131
1132 interface JsApiReporter extends CustomReporter {
1133 new (): any;
1134
1135 started: boolean;
1136 finished: boolean;
1137 runDetails: JasmineDoneInfo;
1138
1139 status(): string;
1140 suiteResults(index: number, length: number): SuiteResult[];
1141 specResults(index: number, length: number): SpecResult[];
1142 suites(): { [id: string]: SuiteResult };
1143 specs(): SpecResult[];
1144 executionTime(): number;
1145 }
1146
1147 interface Jasmine {
1148 Spec: Spec;
1149 clock: Clock;
1150 util: Util;
1151 }
1152
1153 var HtmlReporter: HtmlReporter;
1154 var HtmlSpecFilter: HtmlSpecFilter;
1155
1156 /**
1157 * Default number of milliseconds Jasmine will wait for an asynchronous spec to complete.
1158 */
1159 var DEFAULT_TIMEOUT_INTERVAL: number;
1160
1161 /**
1162 * Maximum number of array elements to display when pretty printing objects.
1163 * This will also limit the number of keys and values displayed for an object.
1164 * Elements past this number will be ellipised.
1165 */
1166 var MAX_PRETTY_PRINT_ARRAY_LENGTH: number;
1167
1168 /**
1169 * Maximum number of characters to display when pretty printing objects.
1170 * Characters past this number will be ellipised.
1171 */
1172 var MAX_PRETTY_PRINT_CHARS: number;
1173
1174 /**
1175 * Maximum object depth the pretty printer will print to.
1176 * Set this to a lower value to speed up pretty printing if you have large objects.
1177 */
1178 var MAX_PRETTY_PRINT_DEPTH: number;
1179
1180 var version: string;
1181
1182 interface JasmineOptions {
1183 /**
1184 * The path to the project's base directory. This can be absolute or relative
1185 * to the current working directory. If it isn't specified, the current working
1186 * directory will be used.
1187 */
1188 projectBaseDir?: string;
1189 }
1190
1191 interface JasmineConfig {
1192 /**
1193 * Whether to fail specs that contain no expectations.
1194 * @default false
1195 */
1196 failSpecWithNoExpectations?: boolean;
1197 /**
1198 * An array of helper file paths or globs that match helper files. Each path or
1199 * glob will be evaluated relative to the spec directory. Helpers are loaded before specs.
1200 */
1201 helpers?: string[];
1202 /**
1203 * Specifies how to load files with names ending in .js. Valid values are
1204 * "require" and "import". "import" should be safe in all cases, and is
1205 * required if your project contains ES modules with filenames ending in .js.
1206 * @default "require"
1207 */
1208 jsLoader?: "require" | "import";
1209 /**
1210 * Whether to run specs in a random order.
1211 */
1212 random?: boolean;
1213 /**
1214 * An array of module names to load via require() at the start of execution.
1215 */
1216 requires?: string[];
1217 /**
1218 * The directory that spec files are contained in, relative to the project base directory.
1219 */
1220 spec_dir?: string;
1221 /**
1222 * An array of spec file paths or globs that match helper files. Each path
1223 * or glob will be evaluated relative to the spec directory.
1224 */
1225 spec_files?: string[];
1226 /**
1227 * Whether to stop suite execution on the first spec failure.
1228 */
1229 stopOnSpecFailure?: boolean;
1230 /**
1231 * Whether to stop each spec on the first expectation failure.
1232 */
1233 stopSpecOnExpectationFailure?: boolean;
1234 }
1235
1236 interface DefaultReporterOptions {
1237 timer?: any;
1238 print?: (...args: any[]) => void;
1239 showColors?: boolean;
1240 jasmineCorePath?: string;
1241 }
1242}
1243
1244declare module "jasmine" {
1245 class jasmine {
1246 jasmine: jasmine.Jasmine;
1247 env: jasmine.Env;
1248 /**
1249 * @deprecated Private property that may be changed or removed in the future
1250 */
1251 reportersCount: number;
1252 /**
1253 * @deprecated Private property that may be changed or removed in the future
1254 */
1255 reporter: jasmine.CustomReporter;
1256 /**
1257 * @deprecated Private property that may be changed or removed in the future
1258 */
1259 showingColors: boolean;
1260 /**
1261 * @deprecated Private property that may be changed or removed in the future
1262 */
1263 projectBaseDir: string;
1264 /**
1265 * @deprecated Private property that may be changed or removed in the future
1266 */
1267 specDir: string;
1268 /**
1269 * @deprecated Private property that may be changed or removed in the future
1270 */
1271 specFiles: string[];
1272 /**
1273 * @deprecated Private property that may be changed or removed in the future
1274 */
1275 helperFiles: string[];
1276 /**
1277 * @deprecated Private property that may be changed or removed in the future
1278 */
1279 requires: string[];
1280 /**
1281 * @deprecated Private property that may be changed or removed in the future
1282 */
1283 defaultReporterConfigured: boolean;
1284
1285 constructor(options?: jasmine.JasmineOptions);
1286 addMatchers(matchers: jasmine.CustomMatcherFactories): void;
1287 /**
1288 * Add a custom reporter to the Jasmine environment.
1289 */
1290 addReporter(reporter: jasmine.CustomReporter): void;
1291 /**
1292 * Adds a spec file to the list that will be loaded when the suite is executed.
1293 */
1294 addSpecFile(filePath: string): void;
1295 addMatchingSpecFiles(patterns: string[]): void;
1296 addHelperFile(filePath: string): void;
1297 addMatchingHelperFiles(patterns: string[]): void;
1298 /**
1299 * @deprecated Private method that may be changed or removed in the future
1300 */
1301 addRequires(files: string[]): void;
1302 /**
1303 * Configure the default reporter.
1304 */
1305 configureDefaultReporter(options: jasmine.DefaultReporterOptions): void;
1306 execute(files?: string[], filterString?: string): Promise<jasmine.JasmineDoneInfo>;
1307 exitOnCompletion: boolean;
1308 loadConfig(config: jasmine.JasmineConfig): void;
1309 loadConfigFile(configFilePath?: string): void;
1310 /**
1311 * @deprecated Private method that may be changed or removed in the future
1312 */
1313 loadHelpers(): Promise<void>;
1314 /**
1315 * @deprecated Private method that may be changed or removed in the future
1316 */
1317 loadSpecs(): Promise<void>;
1318 /**
1319 * @deprecated Private method that may be changed or removed in the future
1320 */
1321 loadRequires(): void;
1322
1323 /**
1324 * Provide a fallback reporter if no other reporters have been specified.
1325 */
1326 provideFallbackReporter(reporter: jasmine.CustomReporter): void;
1327 /**
1328 * Clears all registered reporters.
1329 */
1330 clearReporters(): void;
1331 /**
1332 * Sets whether to randomize the order of specs.
1333 */
1334 randomizeTests(value: boolean): void;
1335 /**
1336 * Sets the random seed.
1337 */
1338 seed(value: number): void;
1339 /**
1340 * Sets whether to show colors in the console reporter.
1341 */
1342 showColors(value: boolean): void;
1343 stopSpecOnExpectationFailure(value: boolean): void;
1344 stopOnSpecFailure(value: boolean): void;
1345 static ConsoleReporter(): any;
1346
1347 /**
1348 * The version of jasmine-core in use
1349 */
1350 coreVersion(): string;
1351 }
1352 export = jasmine;
1353}