Simplify test for arguments passed
This commit is contained in:
@@ -41,14 +41,12 @@ describe('toHaveSpyInteractions', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
[['argument'], [false, 0]].forEach(function(testValue) {
|
it('throws error if arguments are passed', function() {
|
||||||
it(`throws error if arguments (${testValue}) are passed`, function() {
|
let spyObj = jasmineUnderTest.getEnv().createSpyObj('NewClass', ['spyA', 'spyB']);
|
||||||
let spyObj = jasmineUnderTest.getEnv().createSpyObj('NewClass', ['spyA', 'spyB']);
|
|
||||||
|
|
||||||
expect(function() {
|
expect(function() {
|
||||||
expect(spyObj).toHaveSpyInteractions(...testValue);
|
expect(spyObj).toHaveSpyInteractions('an argument');
|
||||||
}).toThrowError(Error, /Does not take arguments/);
|
}).toThrowError(Error, /Does not take arguments/);
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('throws error if spy object has no spies', function() {
|
it('throws error if spy object has no spies', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user