mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-24 11:29:30 +08:00
Added arrayContaining test
This commit is contained in:
@@ -657,6 +657,30 @@ describe("jasmine.objectContaining", function () {
|
||||
});
|
||||
});
|
||||
|
||||
describe("jasmine.arrayContaining", function() {
|
||||
var foo;
|
||||
|
||||
beforeEach(function() {
|
||||
foo = [1, 2, 3, 4];
|
||||
});
|
||||
|
||||
it("matches arrays with some of the values", function() {
|
||||
expect(foo).toEqual(jasmine.arrayContaining([3, 1]));
|
||||
expect(foo).not.toEqual(jasmine.arrayContaining([6]));
|
||||
});
|
||||
|
||||
describe("when used with a spy", function() {
|
||||
it("is useful when comparing arguments", function() {
|
||||
var callback = jasmine.createSpy('callback');
|
||||
|
||||
callback([1, 2, 3, 4]);
|
||||
|
||||
expect(callback).toHaveBeenCalledWith(jasmine.arrayContaining([4, 2, 3]));
|
||||
expect(callback).not.toHaveBeenCalledWith(jasmine.arrayContaining([5, 2]));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("Manually ticking the Jasmine Clock", function () {
|
||||
var timerCallback: any;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user