type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
() => { const foo = () => { throw new TypeError("foo bar baz"); }; expect(foo).toThrowError("foo bar baz"); expect(foo).toThrowError(/bar/); expect(foo).toThrowError(TypeError); expect(foo).toThrowError(TypeError, "foo bar baz"); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { throw new TypeError("foo bar baz"); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { class MyClass { } expect(new MyClass()).toBeInstanceOf(MyClass); expect('foo').toBeInstanceOf(String); expect(3).toBeInstanceOf(Number); expect(new Error()).toBeInstanceOf(Error); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
async () => { const badness = new Error("badness"); await expectAsync(Promise.resolve()).toBeResolved(); await expectAsync(Promise.resolve()).toBeResolved("good job"); await expectAsync(Promise.resolve(true)).toBeResolvedTo(true); await expectAsync(Promise.reject(badness)).toBeR...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
async () => { const badness = new Error("badness"); const malady = new Error("malady"); await expectAsync(Promise.reject(badness)).not.toBeResolved(); await expectAsync(Promise.resolve(true)).not.toBeResolvedTo(false); await expectAsync(Promise.resolve()).not.toBeRejected(); ...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(() => { ({} as any).doSomething(); }).toThrowMatching(error => error !== undefined); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { ({} as any).doSomething(); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
error => error !== undefined
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect("").toBeNegativeInfinity(); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect("").toBePositiveInfinity(); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { const element: HTMLElement = null!; expect(element).toHaveClass("some-class"); expect(element).toHaveClass(Element); // $ExpectError }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { it("is just a function, so it can contain any code", () => { var foo = 0; foo += 1; expect(foo).toEqual(1); }); it("can have more than one expectation", () => { var foo = 0; foo += 1; expect(foo).toEqual(1); expect(true).toEqual(true); ...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { var foo = 0; foo += 1; expect(foo).toEqual(1); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { var foo = 0; foo += 1; expect(foo).toEqual(1); expect(true).toEqual(true); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { var foo: number; beforeEach(() => { foo = 0; foo += 1; }); afterEach(() => { foo = 0; }); it("is just a function, so it can contain any code", () => { expect(foo).toEqual(1); }); it("can have more than one expectation", () => { expect(...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { foo = 0; foo += 1; }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { foo = 0; }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(foo).toEqual(1); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(foo).toEqual(1); expect(true).toEqual(true); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { var foo: number; beforeEach(() => { foo = 0; foo += 1; }); afterEach(() => { foo = 0; }); it("is just a function, so it can contain any code", () => { expect(foo).toEqual(1); }); it("can have more than one expectation", () => { expect(...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { var bar: number; beforeEach(() => { bar = 1; }); it("can reference both scopes as needed", () => { expect(foo).toEqual(bar); }); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { bar = 1; }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(foo).toEqual(bar); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { it("can be used after an expectation", () => { expect(1).withContext('context message').toBe(1); }); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(1).withContext('context message').toBe(1); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { var foo: number; beforeEach(() => { foo = 0; foo += 1; }); it("is just a function, so it can contain any code", () => { expect(foo).toEqual(1); }); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { xit("can be declared 'xit'", () => { expect(true).toBe(false); }); it("can be declared with 'it' but without a function"); it("can be declared by calling 'pending' in the spec body", () => { expect(true).toBe(false); pending(); // without reason pending('this i...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(true).toBe(false); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(true).toBe(false); pending(); // without reason pending('this is why it is pending'); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { var foo: any, bar: any, baz: any = null; beforeEach(() => { foo = { setBar: (value: any) => { bar = value; }, setBaz: (value: any) => { baz = value; } }; spyOn(foo, 'setBar'); spyOn(foo, 's...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { foo = { setBar: (value: any) => { bar = value; }, setBaz: (value: any) => { baz = value; } }; spyOn(foo, 'setBar'); spyOn(foo, 'setBaz'); foo.setBar(123); foo.setBar(456, 'another p...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
(value: any) => { bar = value; }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
(value: any) => { baz = value; }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(foo.setBar).toHaveBeenCalled(); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(foo.setBar).toHaveBeenCalledWith(123); expect(foo.setBar).toHaveBeenCalledWith(456, 'another param'); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(foo.setBar).toHaveBeenCalledBefore(foo.setBaz); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(bar).toBeNull(); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { var foo: any, bar: any, fetchedBar: any; beforeEach(() => { foo = { setBar: (value: any) => { bar = value; }, getBar: () => { return bar; } }; spyOn(foo, 'getBar').and.callThrough(); foo.s...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { foo = { setBar: (value: any) => { bar = value; }, getBar: () => { return bar; } }; spyOn(foo, 'getBar').and.callThrough(); foo.setBar(123); fetchedBar = foo.getBar(); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { return bar; }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(foo.getBar).toHaveBeenCalled(); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(bar).toEqual(123); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(fetchedBar).toEqual(123); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { var bar: number; const foo = { setBar: (value: number) => { bar = value; }, getBar: () => { return bar; } }; it("verifies return value type", () => { spyOn(foo, "getBar").and.returnValue(745); spyOn(foo, "getBar").and.retu...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
(value: number) => { bar = value; }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { return bar; }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { spyOn(foo, "getBar").and.returnValue(745); spyOn(foo, "getBar").and.returnValue("42"); // $ExpectError }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { const fetchedBar = foo.getBar(); expect(fetchedBar).toEqual(745); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { var foo: any, bar: any; beforeEach(() => { foo = { setBar: (value: any) => { bar = value; }, getBar: () => { return bar; } }; spyOn(foo, "getBar").and.returnValues("fetched first", "fetched second"...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { foo = { setBar: (value: any) => { bar = value; }, getBar: () => { return bar; } }; spyOn(foo, "getBar").and.returnValues("fetched first", "fetched second"); foo.setBar(123); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { foo.getBar(123); expect(foo.getBar).toHaveBeenCalled(); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(foo.getBar()).toEqual("fetched first"); expect(foo.getBar()).toEqual("fetched second"); expect(foo.getBar()).toBeUndefined(); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { const bar = 10; const foo = { getAsyncBar: () => { return Promise.resolve(bar); } }; it("verifies return value type", () => { spyOn(foo, "getAsyncBar").and.resolveTo(745); spyOn(foo, "getAsyncBar").and.resolveTo("42"); // $ExpectError }); it...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { return Promise.resolve(bar); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { spyOn(foo, "getAsyncBar").and.resolveTo(745); spyOn(foo, "getAsyncBar").and.resolveTo("42"); // $ExpectError }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
async () => { await foo.getAsyncBar(); expect(foo.getAsyncBar).toHaveBeenCalled(); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
async () => { spyOn(foo, "getAsyncBar").and.resolveTo(745); await expectAsync(foo.getAsyncBar()).toBeResolvedTo(745); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { const bar = 10; const foo = { getAsyncBar: () => { return Promise.resolve(bar); }, getBar: () => { return bar; } }; it("verifies rejection value type", () => { spyOn(foo, "getAsyncBar").and.rejectWith("Error message"); spy...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { spyOn(foo, "getAsyncBar").and.rejectWith("Error message"); spyOn(foo, "getBar").and.rejectWith("42"); // $ExpectError }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
async () => { spyOn(foo, "getAsyncBar").and.rejectWith("Error message"); await expectAsync(foo.getAsyncBar()).toBeRejectedWith("Error message"); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { var foo: any, bar: any, fetchedBar: any; beforeEach(() => { foo = { setBar: (value: any) => { bar = value; }, getBar: () => { return bar; } }; spyOn(foo, "getBar").and.callFake(() => { ...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { foo = { setBar: (value: any) => { bar = value; }, getBar: () => { return bar; } }; spyOn(foo, "getBar").and.callFake(() => { return 1001; }); foo.setBar(123); fetchedBar...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { return 1001; }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(fetchedBar).toEqual(1001); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { var foo: any, bar: any, fetchedBar: any; beforeEach(() => { foo = { setBar: (value: any) => { bar = value; }, getBar: () => { return bar; } }; spyOn(foo, "getBar") .withArgs(1, "2") ...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { foo = { setBar: (value: any) => { bar = value; }, getBar: () => { return bar; } }; spyOn(foo, "getBar") .withArgs(1, "2") .and.callFake(() => 1002); foo.setBar(123); ...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => 1002
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(fetchedBar).toEqual(1002); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { var foo: any, bar: any; beforeEach(() => { foo = { setBar: (value: any) => { bar = value; } }; spyOn(foo, "setBar").and.throwError("quux"); }); it("throws the value", () => { expect(() => { foo.setBar(123); ...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { foo = { setBar: (value: any) => { bar = value; } }; spyOn(foo, "setBar").and.throwError("quux"); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(() => { foo.setBar(123); }).toThrowError("quux"); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { foo.setBar(123); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { var foo: any, bar: any, fetchedBar: any; var fakeCalled = false; beforeEach(() => { foo = { setBar: (value: any) => { bar = value; }, getBar: () => { return bar; } }; spyOn(foo, 'getBar').and.c...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { foo = { setBar: (value: any) => { bar = value; }, getBar: () => { return bar; } }; spyOn(foo, 'getBar').and.callThrough().and.callFake(() => { fakeCalled = true; }); foo.setBar(...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { fakeCalled = true; }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(fakeCalled).toEqual(true); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { var foo: any, bar: any = null; beforeEach(() => { foo = { setBar: (value: any) => { bar = value; } }; spyOn(foo, 'setBar').and.callThrough(); }); it("can call through and then stub in the same spec", () => { foo.setBar(1...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { foo = { setBar: (value: any) => { bar = value; } }; spyOn(foo, 'setBar').and.callThrough(); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { foo.setBar(123); expect(bar).toEqual(123); foo.setBar.and.stub(); bar = null; foo.setBar(123); expect(bar).toBe(null); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { var foo: any, bar: any = null; beforeEach(() => { foo = { setBar: (value: any) => { bar = value; } }; spyOn(foo, 'setBar'); }); it("tracks if it was called at all", () => { expect(foo.setBar.calls.any()).toEqual(false); ...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { foo = { setBar: (value: any) => { bar = value; } }; spyOn(foo, 'setBar'); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(foo.setBar.calls.any()).toEqual(false); foo.setBar(); expect(foo.setBar.calls.any()).toEqual(true); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(foo.setBar.calls.count()).toEqual(0); foo.setBar(); foo.setBar(); expect(foo.setBar.calls.count()).toEqual(2); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { foo.setBar(123); foo.setBar(456, "baz"); expect(foo.setBar.calls.argsFor(0)).toEqual([123]); expect(foo.setBar.calls.argsFor(1)).toEqual([456, "baz"]); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { foo.setBar(123); foo.setBar(456, "baz"); expect(foo.setBar.calls.allArgs()).toEqual([[123], [456, "baz"]]); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { foo.setBar(123); expect(foo.setBar.calls.all()).toEqual([{ object: foo, args: [123], returnValue: undefined }]); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { foo.setBar(123); foo.setBar(456, "baz"); expect(foo.setBar.calls.mostRecent()).toEqual({ object: foo, args: [456, "baz"], returnValue: undefined }); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { foo.setBar(123); foo.setBar(456, "baz"); expect(foo.setBar.calls.first()).toEqual({ object: foo, args: [123], returnValue: undefined }); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { foo.setBar(123); foo.setBar(456, "baz"); expect(foo.setBar.calls.any()).toBe(true); foo.setBar.calls.reset(); expect(foo.setBar.calls.any()).toBe(false); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { var whatAmI: any; beforeEach(() => { whatAmI = jasmine.createSpy('whatAmI'); whatAmI("I", "am", "a", "spy"); }); it("is named, which helps in error reporting", () => { expect(whatAmI.and.identity()).toEqual('whatAmI'); }); it("tracks that the spy was called",...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { whatAmI = jasmine.createSpy('whatAmI'); whatAmI("I", "am", "a", "spy"); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(whatAmI.and.identity()).toEqual('whatAmI'); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(whatAmI).toHaveBeenCalled(); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(whatAmI.calls.count()).toEqual(1); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(whatAmI).toHaveBeenCalledWith("I", "am", "a", "spy"); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { expect(whatAmI.calls.mostRecent().args[0]).toEqual("I"); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { interface Test { method<T>(): Array<Box<T>>; } interface Box<T> { value: T; } it("should allow to configure generic method", () => { const spy = jasmine.createSpyObj<Test>('test', ['method']); spy.method.and.returnValue([{ value: 1 }, { value: 2 }]); }...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { const spy = jasmine.createSpyObj<Test>('test', ['method']); spy.method.and.returnValue([{ value: 1 }, { value: 2 }]); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { const spy = jasmine.createSpyObj<Test>(['method']); jasmine.createSpyObj<Test>(['methodUnknown']); // $ExpectError spy.method.and.returnValue([{ value: 1 }, { value: 2 }]); }
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript
ArrowFunction
() => { class Tape { private rewindTo: number; play(): void { } pause(): void { } rewind(pos: number): void { this.rewindTo = pos; } stop(): void { } readonly isPlaying: boolean; // spy obj makes this writable } var tape: Tape; var ta...
Bat-Orshikh/DefinitelyTyped
types/jasmine/ts3.1/jasmine-tests.ts
TypeScript