Run formatter
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
describe('toHaveSpyInteractions', function() {
|
||||
|
||||
it('detects spy interactions', function() {
|
||||
let matcher = jasmineUnderTest.matchers.toHaveSpyInteractions();
|
||||
let spyObj = jasmineUnderTest.getEnv().createSpyObj('NewClass', ['spyA', 'spyB']);
|
||||
let spyObj = jasmineUnderTest
|
||||
.getEnv()
|
||||
.createSpyObj('NewClass', ['spyA', 'spyB']);
|
||||
|
||||
spyObj.spyA();
|
||||
|
||||
@@ -15,7 +16,9 @@ describe('toHaveSpyInteractions', function () {
|
||||
|
||||
it('detects multiple spy interactions', function() {
|
||||
let matcher = jasmineUnderTest.matchers.toHaveSpyInteractions();
|
||||
let spyObj = jasmineUnderTest.getEnv().createSpyObj('NewClass', ['spyA', 'spyB']);
|
||||
let spyObj = jasmineUnderTest
|
||||
.getEnv()
|
||||
.createSpyObj('NewClass', ['spyA', 'spyB']);
|
||||
|
||||
spyObj.spyA();
|
||||
spyObj.spyB();
|
||||
@@ -30,7 +33,9 @@ describe('toHaveSpyInteractions', function () {
|
||||
|
||||
it('detects no spy interactions', function() {
|
||||
let matcher = jasmineUnderTest.matchers.toHaveSpyInteractions();
|
||||
let spyObj = jasmineUnderTest.getEnv().createSpyObj('NewClass', ['spyA', 'spyB']);
|
||||
let spyObj = jasmineUnderTest
|
||||
.getEnv()
|
||||
.createSpyObj('NewClass', ['spyA', 'spyB']);
|
||||
|
||||
let result = matcher.compare(spyObj);
|
||||
expect(result.pass).toBe(false);
|
||||
@@ -41,7 +46,9 @@ describe('toHaveSpyInteractions', function () {
|
||||
|
||||
it('ignores non-observed spy object interactions', function() {
|
||||
let matcher = jasmineUnderTest.matchers.toHaveSpyInteractions();
|
||||
let spyObj = jasmineUnderTest.getEnv().createSpyObj('NewClass', ['spyA', 'spyB']);
|
||||
let spyObj = jasmineUnderTest
|
||||
.getEnv()
|
||||
.createSpyObj('NewClass', ['spyA', 'spyB']);
|
||||
spyObj.otherMethod = function() {};
|
||||
|
||||
spyObj.otherMethod();
|
||||
@@ -65,7 +72,9 @@ describe('toHaveSpyInteractions', function () {
|
||||
|
||||
it('throws error if arguments are passed', function() {
|
||||
let matcher = jasmineUnderTest.matchers.toHaveSpyInteractions();
|
||||
let spyObj = jasmineUnderTest.getEnv().createSpyObj('NewClass', ['spyA', 'spyB']);
|
||||
let spyObj = jasmineUnderTest
|
||||
.getEnv()
|
||||
.createSpyObj('NewClass', ['spyA', 'spyB']);
|
||||
|
||||
expect(function() {
|
||||
matcher.compare(spyObj, 'an argument');
|
||||
@@ -74,7 +83,9 @@ describe('toHaveSpyInteractions', function () {
|
||||
|
||||
it('throws error if spy object has no spies', function() {
|
||||
let matcher = jasmineUnderTest.matchers.toHaveSpyInteractions();
|
||||
const spyObj = jasmineUnderTest.getEnv().createSpyObj('NewClass', ['notSpy']);
|
||||
const spyObj = jasmineUnderTest
|
||||
.getEnv()
|
||||
.createSpyObj('NewClass', ['notSpy']);
|
||||
// Removing spy since spy objects cannot be created without spies.
|
||||
spyObj.notSpy = function() {};
|
||||
|
||||
|
||||
@@ -19,9 +19,7 @@ getJasmineRequireObj().toHaveSpyInteractions = function(j$) {
|
||||
|
||||
if (!j$.isObject_(actual)) {
|
||||
throw new Error(
|
||||
getErrorMsg(
|
||||
'Expected a spy object, but got ' + typeof actual + '.'
|
||||
)
|
||||
getErrorMsg('Expected a spy object, but got ' + typeof actual + '.')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user