@@ -1,7 +1,7 @@
|
||||
describe('toHaveBeenCalled', function() {
|
||||
it('passes when the actual was called, with a custom .not fail message', function() {
|
||||
const matcher = jasmineUnderTest.matchers.toHaveBeenCalled(),
|
||||
calledSpy = new jasmineUnderTest.Spy('called-spy');
|
||||
const matcher = privateUnderTest.matchers.toHaveBeenCalled(),
|
||||
calledSpy = new privateUnderTest.Spy('called-spy');
|
||||
|
||||
calledSpy();
|
||||
|
||||
@@ -13,16 +13,16 @@ describe('toHaveBeenCalled', function() {
|
||||
});
|
||||
|
||||
it('fails when the actual was not called', function() {
|
||||
const matcher = jasmineUnderTest.matchers.toHaveBeenCalled(),
|
||||
uncalledSpy = new jasmineUnderTest.Spy('uncalled spy');
|
||||
const matcher = privateUnderTest.matchers.toHaveBeenCalled(),
|
||||
uncalledSpy = new privateUnderTest.Spy('uncalled spy');
|
||||
|
||||
const result = matcher.compare(uncalledSpy);
|
||||
expect(result.pass).toBe(false);
|
||||
});
|
||||
|
||||
it('throws an exception when the actual is not a spy', function() {
|
||||
const matcher = jasmineUnderTest.matchers.toHaveBeenCalled({
|
||||
pp: jasmineUnderTest.makePrettyPrinter()
|
||||
const matcher = privateUnderTest.matchers.toHaveBeenCalled({
|
||||
pp: privateUnderTest.makePrettyPrinter()
|
||||
}),
|
||||
fn = function() {};
|
||||
|
||||
@@ -32,8 +32,8 @@ describe('toHaveBeenCalled', function() {
|
||||
});
|
||||
|
||||
it('throws an exception when invoked with any arguments', function() {
|
||||
const matcher = jasmineUnderTest.matchers.toHaveBeenCalled(),
|
||||
spy = new jasmineUnderTest.Spy('sample spy');
|
||||
const matcher = privateUnderTest.matchers.toHaveBeenCalled(),
|
||||
spy = new privateUnderTest.Spy('sample spy');
|
||||
|
||||
expect(function() {
|
||||
matcher.compare(spy, 'foo');
|
||||
@@ -41,8 +41,8 @@ describe('toHaveBeenCalled', function() {
|
||||
});
|
||||
|
||||
it('has a custom message on failure', function() {
|
||||
const matcher = jasmineUnderTest.matchers.toHaveBeenCalled(),
|
||||
spy = new jasmineUnderTest.Spy('sample-spy');
|
||||
const matcher = privateUnderTest.matchers.toHaveBeenCalled(),
|
||||
spy = new privateUnderTest.Spy('sample-spy');
|
||||
|
||||
const result = matcher.compare(spy);
|
||||
|
||||
@@ -52,8 +52,8 @@ describe('toHaveBeenCalled', function() {
|
||||
});
|
||||
|
||||
it('set the correct calls as verified when passing', function() {
|
||||
const matcher = jasmineUnderTest.matchers.toHaveBeenCalled(),
|
||||
spy = new jasmineUnderTest.Spy('sample-spy');
|
||||
const matcher = privateUnderTest.matchers.toHaveBeenCalled(),
|
||||
spy = new privateUnderTest.Spy('sample-spy');
|
||||
|
||||
spy();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user