@types/jasmine
Advanced tools
Comparing version 4.3.0 to 5.1.4
@@ -1,20 +0,1 @@ | ||
// Type definitions for Jasmine 4.3 | ||
// Project: http://jasmine.github.io | ||
// Definitions by: Boris Yankov <https://github.com/borisyankov> | ||
// Theodore Brown <https://github.com/theodorejb> | ||
// David Pärsson <https://github.com/davidparsson> | ||
// Lukas Zech <https://github.com/lukas-zech-software> | ||
// Boris Breuer <https://github.com/Engineer2B> | ||
// Chris Yungmann <https://github.com/cyungmann> | ||
// Giles Roadnight <https://github.com/Roaders> | ||
// Yaroslav Admin <https://github.com/devoto13> | ||
// Domas Trijonis <https://github.com/fdim> | ||
// Moshe Kolodny <https://github.com/kolodny> | ||
// Stephen Farrar <https://github.com/stephenfarrar> | ||
// Dominik Ehrenberg <https://github.com/djungowski> | ||
// Chives <https://github.com/chivesrs> | ||
// kirjs <https://github.com/kirjs> | ||
// Md. Enzam Hossain <https://github.com/ienzam> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// For ddescribe / iit use : https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/karma-jasmine/karma-jasmine.d.ts | ||
@@ -185,3 +166,3 @@ | ||
): jasmine.Spy< | ||
T[K] extends jasmine.Func ? T[K] : T[K] extends { new (...args: infer A): infer V } ? (...args: A) => V : never | ||
T[K] extends jasmine.Func ? T[K] : T[K] extends { new(...args: infer A): infer V } ? (...args: A) => V : never | ||
>; | ||
@@ -196,7 +177,59 @@ | ||
declare function spyOnProperty<T, K extends keyof T = keyof T>( | ||
object: T, property: K, accessType?: "get"): jasmine.Spy<(this: T) => T[K]>; | ||
object: T, | ||
property: K, | ||
accessType?: "get", | ||
): jasmine.Spy<(this: T) => T[K]>; | ||
declare function spyOnProperty<T, K extends keyof T = keyof T>( | ||
object: T, property: K, accessType: "set"): jasmine.Spy<(this: T, value: T[K]) => void>; | ||
object: T, | ||
property: K, | ||
accessType: "set", | ||
): jasmine.Spy<(this: T, value: T[K]) => void>; | ||
interface ThrowUnlessFailure { | ||
/** | ||
* The name of the matcher that was executed for this expectation. | ||
*/ | ||
matcherName: string; | ||
/** | ||
* The failure message for the expectation. | ||
*/ | ||
message: string; | ||
/** | ||
* Whether the expectation passed or failed. | ||
*/ | ||
passed: boolean; | ||
/** | ||
* If the expectation failed, what was the expected value. | ||
*/ | ||
expected: any; | ||
/** | ||
* If the expectation failed, what actual value was produced. | ||
*/ | ||
actual: any; | ||
} | ||
/** | ||
* Create an expectation for a spec and throw an error if it fails. | ||
* @checkReturnValue see https://tsetse.info/check-return-value | ||
* @param spy | ||
*/ | ||
declare function throwUnless<T extends jasmine.Func>(spy: T | jasmine.Spy<T>): jasmine.FunctionMatchers<T>; | ||
/** | ||
* Create an expectation for a spec and throw an error if it fails. | ||
* @checkReturnValue see https://tsetse.info/check-return-value | ||
* @param actual Actual computed value to test expectations against. | ||
*/ | ||
declare function throwUnless<T>(actual: ArrayLike<T>): jasmine.ArrayLikeMatchers<T>; | ||
/** | ||
* Create an expectation for a spec and throw an error if it fails. | ||
* @checkReturnValue see https://tsetse.info/check-return-value | ||
* @param actual Actual computed value to test expectations against. | ||
*/ | ||
declare function throwUnless<T>(actual: T): jasmine.Matchers<T>; | ||
/** | ||
* Create an asynchronous expectation for a spec and throw an error if it fails. | ||
* @param actual Actual computed value to test expectations against. | ||
*/ | ||
declare function throwUnlessAsync<T, U>(actual: T | PromiseLike<T>): jasmine.AsyncMatchers<T, U>; | ||
/** | ||
* Installs spies on all writable and configurable properties of an object. | ||
@@ -222,4 +255,4 @@ * @param object The object upon which to install the `Spy`s. | ||
| { | ||
[K in keyof T]: ExpectedRecursive<T[K]> | Any; | ||
}; | ||
[K in keyof T]: ExpectedRecursive<T[K]> | Any; | ||
}; | ||
type Expected<T> = | ||
@@ -232,10 +265,15 @@ | T | ||
| { | ||
[K in keyof T]: ExpectedRecursive<T[K]>; | ||
}; | ||
type SpyObjMethodNames<T = undefined> = T extends undefined | ||
? ReadonlyArray<string> | { [methodName: string]: any } | ||
: ReadonlyArray<keyof T> | { [P in keyof T]?: T[P] extends Func ? ReturnType<T[P]> : any }; | ||
[K in keyof T]: ExpectedRecursive<T[K]>; | ||
}; | ||
type SpyObjMethodNames<T = undefined> = T extends undefined ? readonly string[] | { [methodName: string]: any } | ||
: ( | ||
| ReadonlyArray<keyof T> | ||
| { | ||
[P in keyof T]?: | ||
// Value should be the return type (unless this is a method on Object.prototype, since all object literals contain those methods) | ||
T[P] extends Func ? (ReturnType<T[P]> | (P extends keyof Object ? Object[P] : never)) : any; | ||
} | ||
); | ||
type SpyObjPropertyNames<T = undefined> = T extends undefined | ||
? ReadonlyArray<string> | { [propertyName: string]: any } | ||
type SpyObjPropertyNames<T = undefined> = T extends undefined ? readonly string[] | { [propertyName: string]: any } | ||
: ReadonlyArray<keyof T> | { [P in keyof T]?: T[P] }; | ||
@@ -353,2 +391,11 @@ | ||
/** | ||
* Get an AsymmetricMatcher, usable in any matcher | ||
* that passes if the actual value is the same as the sample as determined | ||
* by the `===` operator. | ||
* @param sample The value to compare the actual to. | ||
* @since 4.2.0 | ||
*/ | ||
function is(sample: any): AsymmetricMatcher<any>; | ||
function arrayContaining<T>(sample: ArrayLike<T>): ArrayContaining<T>; | ||
@@ -391,3 +438,3 @@ function arrayWithExactContents<T>(sample: ArrayLike<T>): ArrayContaining<T>; | ||
function stringContaining(str: string | RegExp): AsymmetricMatcher<string>; | ||
function stringContaining(str: string): AsymmetricMatcher<string>; | ||
/** | ||
@@ -399,3 +446,3 @@ * @deprecated Private method that may be changed or removed in the future | ||
interface Any extends AsymmetricMatcher<any> { | ||
new (expectedClass: any): any; | ||
new(expectedClass: any): any; | ||
jasmineToString(prettyPrint: (value: any) => string): string; | ||
@@ -435,2 +482,3 @@ } | ||
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type | ||
type CustomEqualityTester = (first: any, second: any) => boolean | void; | ||
@@ -485,3 +533,3 @@ | ||
haystack: ArrayLike<T> | string, | ||
needle: any | ||
needle: any, | ||
): boolean; | ||
@@ -510,4 +558,2 @@ /** | ||
configure(configuration: Configuration): void; | ||
execute(runnablesToRun: Suite[] | null | undefined, onComplete: Func): void; | ||
/** @async */ | ||
execute(runnablesToRun?: Suite[]): PromiseLike<JasmineDoneInfo>; | ||
@@ -531,7 +577,7 @@ provideFallbackReporter(reporter: CustomReporter): void; | ||
interface HtmlReporter { | ||
new (): any; | ||
new(): any; | ||
} | ||
interface HtmlSpecFilter { | ||
new (): any; | ||
new(): any; | ||
} | ||
@@ -558,3 +604,3 @@ | ||
interface Order { | ||
new (options: { random: boolean; seed: number | string }): any; | ||
new(options: { random: boolean; seed: number | string }): any; | ||
random: boolean; | ||
@@ -691,3 +737,3 @@ seed: number | string; | ||
toThrowError(message?: string | RegExp): void; | ||
toThrowError(expected?: new (...args: any[]) => Error, message?: string | RegExp): void; | ||
toThrowError(expected?: new(...args: any[]) => Error, message?: string | RegExp): void; | ||
toThrowMatching(predicate: (thrown: any) => boolean): void; | ||
@@ -885,3 +931,3 @@ toBeNegativeInfinity(): void; | ||
*/ | ||
toBeRejectedWithError(expected?: new (...args: any[]) => Error, message?: string | RegExp): PromiseLike<void>; | ||
toBeRejectedWithError(expected?: new(...args: any[]) => Error, message?: string | RegExp): PromiseLike<void>; | ||
@@ -1035,3 +1081,3 @@ /** | ||
interface Spec { | ||
new (attrs: any): any; | ||
new(attrs: any): any; | ||
@@ -1057,4 +1103,5 @@ readonly id: number; | ||
type SpyObj<T> = T & | ||
{ | ||
type SpyObj<T> = | ||
& T | ||
& { | ||
[K in keyof T]: T[K] extends Func ? T[K] & Spy<T[K]> : T[K]; | ||
@@ -1079,5 +1126,3 @@ }; | ||
*/ | ||
type PromisedReturnType<Fn extends Func> = Fn extends (...args: any[]) => PromiseLike<infer TResult> | ||
? TResult | ||
: never; | ||
type PromisedResolveType<T> = T extends PromiseLike<infer TResult> ? TResult : never; | ||
@@ -1088,3 +1133,3 @@ /** | ||
*/ | ||
type PromisedRejectType<Fn extends Function> = Fn extends (...args: any[]) => PromiseLike<unknown> ? any : never; | ||
type PromisedRejectType<T> = T extends PromiseLike<unknown> ? any : never; | ||
@@ -1103,5 +1148,5 @@ interface SpyAnd<Fn extends Func> { | ||
/** Tell the spy to return a promise resolving to the specified value when invoked. */ | ||
resolveTo(val?: PromisedReturnType<Fn>): Spy<Fn>; | ||
resolveTo(val?: PromisedResolveType<ReturnType<Fn>>): Spy<Fn>; | ||
/** Tell the spy to return a promise rejecting with the specified value when invoked. */ | ||
rejectWith(val?: PromisedRejectType<Fn>): Spy<Fn>; | ||
rejectWith(val?: PromisedRejectType<ReturnType<Fn>>): Spy<Fn>; | ||
/** By chaining the spy with and.throwError, all calls to the spy will throw the specified value. */ | ||
@@ -1154,3 +1199,3 @@ throwError(msg: string | Error): Spy; | ||
interface JsApiReporter extends CustomReporter { | ||
new (): any; | ||
new(): any; | ||
@@ -1157,0 +1202,0 @@ started: boolean; |
{ | ||
"name": "@types/jasmine", | ||
"version": "4.3.0", | ||
"description": "TypeScript definitions for Jasmine", | ||
"version": "5.1.4", | ||
"description": "TypeScript definitions for jasmine", | ||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jasmine", | ||
@@ -10,74 +10,74 @@ "license": "MIT", | ||
"name": "Boris Yankov", | ||
"url": "https://github.com/borisyankov", | ||
"githubUsername": "borisyankov" | ||
"githubUsername": "borisyankov", | ||
"url": "https://github.com/borisyankov" | ||
}, | ||
{ | ||
"name": "Theodore Brown", | ||
"url": "https://github.com/theodorejb", | ||
"githubUsername": "theodorejb" | ||
"githubUsername": "theodorejb", | ||
"url": "https://github.com/theodorejb" | ||
}, | ||
{ | ||
"name": "David Pärsson", | ||
"url": "https://github.com/davidparsson", | ||
"githubUsername": "davidparsson" | ||
"githubUsername": "davidparsson", | ||
"url": "https://github.com/davidparsson" | ||
}, | ||
{ | ||
"name": "Lukas Zech", | ||
"url": "https://github.com/lukas-zech-software", | ||
"githubUsername": "lukas-zech-software" | ||
"githubUsername": "lukas-zech-software", | ||
"url": "https://github.com/lukas-zech-software" | ||
}, | ||
{ | ||
"name": "Boris Breuer", | ||
"url": "https://github.com/Engineer2B", | ||
"githubUsername": "Engineer2B" | ||
"githubUsername": "Engineer2B", | ||
"url": "https://github.com/Engineer2B" | ||
}, | ||
{ | ||
"name": "Chris Yungmann", | ||
"url": "https://github.com/cyungmann", | ||
"githubUsername": "cyungmann" | ||
"githubUsername": "cyungmann", | ||
"url": "https://github.com/cyungmann" | ||
}, | ||
{ | ||
"name": "Giles Roadnight", | ||
"url": "https://github.com/Roaders", | ||
"githubUsername": "Roaders" | ||
"githubUsername": "Roaders", | ||
"url": "https://github.com/Roaders" | ||
}, | ||
{ | ||
"name": "Yaroslav Admin", | ||
"url": "https://github.com/devoto13", | ||
"githubUsername": "devoto13" | ||
"githubUsername": "devoto13", | ||
"url": "https://github.com/devoto13" | ||
}, | ||
{ | ||
"name": "Domas Trijonis", | ||
"url": "https://github.com/fdim", | ||
"githubUsername": "fdim" | ||
"githubUsername": "fdim", | ||
"url": "https://github.com/fdim" | ||
}, | ||
{ | ||
"name": "Moshe Kolodny", | ||
"url": "https://github.com/kolodny", | ||
"githubUsername": "kolodny" | ||
"githubUsername": "kolodny", | ||
"url": "https://github.com/kolodny" | ||
}, | ||
{ | ||
"name": "Stephen Farrar", | ||
"url": "https://github.com/stephenfarrar", | ||
"githubUsername": "stephenfarrar" | ||
"githubUsername": "stephenfarrar", | ||
"url": "https://github.com/stephenfarrar" | ||
}, | ||
{ | ||
"name": "Dominik Ehrenberg", | ||
"url": "https://github.com/djungowski", | ||
"githubUsername": "djungowski" | ||
"githubUsername": "djungowski", | ||
"url": "https://github.com/djungowski" | ||
}, | ||
{ | ||
"name": "Chives", | ||
"url": "https://github.com/chivesrs", | ||
"githubUsername": "chivesrs" | ||
"githubUsername": "chivesrs", | ||
"url": "https://github.com/chivesrs" | ||
}, | ||
{ | ||
"name": "kirjs", | ||
"url": "https://github.com/kirjs", | ||
"githubUsername": "kirjs" | ||
"githubUsername": "kirjs", | ||
"url": "https://github.com/kirjs" | ||
}, | ||
{ | ||
"name": "Md. Enzam Hossain", | ||
"url": "https://github.com/ienzam", | ||
"githubUsername": "ienzam" | ||
"name": "Dmitry Semigradsky", | ||
"githubUsername": "Semigradsky", | ||
"url": "https://github.com/Semigradsky" | ||
} | ||
@@ -94,4 +94,4 @@ ], | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "e1565b6a83b34ee520f93b61e955fbdee4e78c1f1c35de8e107b754e0a061ac7", | ||
"typeScriptVersion": "4.0" | ||
"typesPublisherContentHash": "b237dd24e928d5399e4eb8f2b580757f7ca220560b224ff7b6d26c9e0b346ba6", | ||
"typeScriptVersion": "4.5" | ||
} |
@@ -5,3 +5,3 @@ # Installation | ||
# Summary | ||
This package contains type definitions for Jasmine (http://jasmine.github.io). | ||
This package contains type definitions for jasmine (http://jasmine.github.io). | ||
@@ -12,7 +12,6 @@ # Details | ||
### Additional Details | ||
* Last updated: Tue, 23 Aug 2022 05:02:34 GMT | ||
* Last updated: Wed, 22 Nov 2023 00:24:48 GMT | ||
* Dependencies: none | ||
* Global values: `afterAll`, `afterEach`, `beforeAll`, `beforeEach`, `describe`, `expect`, `expectAsync`, `fail`, `fdescribe`, `fit`, `it`, `jasmine`, `pending`, `setSpecProperty`, `setSuiteProperty`, `spyOn`, `spyOnAllFunctions`, `spyOnProperty`, `xdescribe`, `xit` | ||
# Credits | ||
These definitions were written by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb), [David Pärsson](https://github.com/davidparsson), [Lukas Zech](https://github.com/lukas-zech-software), [Boris Breuer](https://github.com/Engineer2B), [Chris Yungmann](https://github.com/cyungmann), [Giles Roadnight](https://github.com/Roaders), [Yaroslav Admin](https://github.com/devoto13), [Domas Trijonis](https://github.com/fdim), [Moshe Kolodny](https://github.com/kolodny), [Stephen Farrar](https://github.com/stephenfarrar), [Dominik Ehrenberg](https://github.com/djungowski), [Chives](https://github.com/chivesrs), [kirjs](https://github.com/kirjs), and [Md. Enzam Hossain](https://github.com/ienzam). | ||
These definitions were written by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb), [David Pärsson](https://github.com/davidparsson), [Lukas Zech](https://github.com/lukas-zech-software), [Boris Breuer](https://github.com/Engineer2B), [Chris Yungmann](https://github.com/cyungmann), [Giles Roadnight](https://github.com/Roaders), [Yaroslav Admin](https://github.com/devoto13), [Domas Trijonis](https://github.com/fdim), [Moshe Kolodny](https://github.com/kolodny), [Stephen Farrar](https://github.com/stephenfarrar), [Dominik Ehrenberg](https://github.com/djungowski), [Chives](https://github.com/chivesrs), [kirjs](https://github.com/kirjs), and [Dmitry Semigradsky](https://github.com/Semigradsky). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57831
1237
16