Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

unexpected-sinon

Package Overview
Dependencies
Maintainers
2
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unexpected-sinon - npm Package Compare versions

Comparing version 9.1.0 to 10.0.0

16

documentation/assertions/array/given-call-order.md

@@ -27,7 +27,5 @@ Passes if the provided spies where called in the specified order.

[
foo() at theFunction (theFileName:xx:yy) // spy: expected foo to be bar
bar() at theFunction (theFileName:xx:yy) // spy: expected bar to be foo
baz() at theFunction (theFileName:xx:yy)
]
foo(); at theFunction (theFileName:xx:yy) // spy: expected foo to be bar
bar(); at theFunction (theFileName:xx:yy) // spy: expected bar to be foo
baz(); at theFunction (theFileName:xx:yy)
```

@@ -56,7 +54,5 @@

[
spy1() at theFunction (theFileName:xx:yy)
spy2() at theFunction (theFileName:xx:yy)
spy1() at theFunction (theFileName:xx:yy) // spy: expected spy1 to be spy2
]
spy1(); at theFunction (theFileName:xx:yy)
spy2(); at theFunction (theFileName:xx:yy)
spy1(); at theFunction (theFileName:xx:yy) // spy: expected spy1 to be spy2
```

@@ -56,21 +56,19 @@ Passes if the "timeline" of all the calls of a set of spies [satisfies](http://unexpected.js.org/assertions/any/to-satisfy/) a given spec:

[
increment(
456 // should equal 123
) at theFunction (theFileName:xx:yy)
noop( 987 ) at theFunction (theFileName:xx:yy)
increment( 123 ) at theFunction (theFileName:xx:yy)
// returned: expected 124 to equal 557
noop( 555 ) at theFunction (theFileName:xx:yy)
increment( 666 ) at theFunction (theFileName:xx:yy)
// threw: expected Error('No, I won\'t do that')
// to satisfy { message: expect.it('not to match', /^No/) }
//
// {
// message: 'No, I won\'t do that' // should not match /^No/
// //
// // No, I won't do that
// // ^^
// }
]
increment(
456 // should equal 123
); at theFunction (theFileName:xx:yy)
noop( 987 ); at theFunction (theFileName:xx:yy)
increment( 123 ); at theFunction (theFileName:xx:yy)
// returned: expected 124 to equal 557
noop( 555 ); at theFunction (theFileName:xx:yy)
increment( 666 ); at theFunction (theFileName:xx:yy)
// threw: expected Error('No, I won\'t do that')
// to satisfy { message: expect.it('not to match', /^No/) }
//
// {
// message: 'No, I won\'t do that' // should not match /^No/
// //
// // No, I won't do that
// // ^^
// }
```

@@ -102,10 +100,8 @@

[
mySpy(
{
foo: 123,
bar: 456 // should be removed
}
) at theFunction (theFileName:xx:yy)
]
mySpy(
{
foo: 123,
bar: 456 // should be removed
}
); at theFunction (theFileName:xx:yy)
```

@@ -134,17 +130,13 @@

expected [ spy1, spy2 ] to have calls satisfying
[
spy1( 123 )
spy2( 456 )
spy1( expect.it('to be a string') )
spy2( 789 )
]
spy1( 123 );
spy2( 456 );
spy1( expect.it('to be a string') );
spy2( 789 );
[
spy1( 123 ) at theFunction (theFileName:xx:yy)
spy2( 456 ) at theFunction (theFileName:xx:yy)
spy1(
false // should be a string
) at theFunction (theFileName:xx:yy)
spy2( 789 ) at theFunction (theFileName:xx:yy)
]
spy1( 123 ); at theFunction (theFileName:xx:yy)
spy2( 456 ); at theFunction (theFileName:xx:yy)
spy1(
false // should be a string
); at theFunction (theFileName:xx:yy)
spy2( 789 ); at theFunction (theFileName:xx:yy)
```

@@ -52,8 +52,6 @@ Passes if the spy threw the given exception.

[
myStub() at theFunction (theFileName:xx:yy)
// expected: threw /waat/
// expected TypeError('wat') to satisfy /waat/
myStub() at theFunction (theFileName:xx:yy)
]
myStub(); at theFunction (theFileName:xx:yy)
// expected: threw /waat/
// expected TypeError('wat') to satisfy /waat/
myStub(); at theFunction (theFileName:xx:yy)
```

@@ -31,9 +31,7 @@ Passes if all the calls of a spy [satisfy](http://unexpected.js.org/assertions/any/to-satisfy/) a given spec:

[
increment( 42 ) at theFunction (theFileName:xx:yy)
increment(
46, // should equal 20
'yadda' // should be removed
) at theFunction (theFileName:xx:yy)
]
increment( 42 ); at theFunction (theFileName:xx:yy)
increment(
46, // should equal 20
'yadda' // should be removed
); at theFunction (theFileName:xx:yy)
```

@@ -65,10 +63,8 @@

[
mySpy(
{
foo: 123,
bar: 456 // should be removed
}
) at theFunction (theFileName:xx:yy)
]
mySpy(
{
foo: 123,
bar: 456 // should be removed
}
); at theFunction (theFileName:xx:yy)
```

@@ -92,12 +88,8 @@

expected increment to have calls satisfying
[
increment( 1 )
increment( expect.it('to be a number') )
]
increment( 1 );
increment( expect.it('to be a number') );
[
increment( 1 ) at theFunction (theFileName:xx:yy)
increment( 2 ) at theFunction (theFileName:xx:yy)
increment( 3 ) at theFunction (theFileName:xx:yy) // should be removed
]
increment( 1 ); at theFunction (theFileName:xx:yy)
increment( 2 ); at theFunction (theFileName:xx:yy)
increment( 3 ); at theFunction (theFileName:xx:yy) // should be removed
```

@@ -19,7 +19,5 @@ Passes if the spy was ever called with obj as its `this` value.

[
mySpy() at theFunction (theFileName:xx:yy)
// expected: was called on {}
// expected mySpy to be called with {} as this but was called with { spy: mySpy }
]
mySpy(); at theFunction (theFileName:xx:yy)
// expected: was called on {}
// expected mySpy to be called with {} as this but was called with { spy: mySpy }
```

@@ -45,8 +43,6 @@

[
mySpy() at theFunction (theFileName:xx:yy)
mySpy() at theFunction (theFileName:xx:yy)
// expected: was called on { spy: mySpy }
// expected mySpy to be called with { spy: mySpy } as this but was called with {}
]
mySpy(); at theFunction (theFileName:xx:yy)
mySpy(); at theFunction (theFileName:xx:yy)
// expected: was called on { spy: mySpy }
// expected mySpy to be called with { spy: mySpy } as this but was called with {}
```

@@ -25,8 +25,6 @@ Passes if the spy was called exactly the specified number of times.

expected
[
add( 41, 42 ) at theFunction (theFileName:xx:yy)
add( 41, 43 ) at theFunction (theFileName:xx:yy)
add( 41, 44 ) at theFunction (theFileName:xx:yy)
add( 41, 45 ) at theFunction (theFileName:xx:yy)
]
add( 41, 42 ); at theFunction (theFileName:xx:yy)
add( 41, 43 ); at theFunction (theFileName:xx:yy)
add( 41, 44 ); at theFunction (theFileName:xx:yy)
add( 41, 45 ); at theFunction (theFileName:xx:yy)
to have length 2

@@ -33,0 +31,0 @@ expected 4 to be 2

@@ -18,10 +18,8 @@ Passes if the spy was called with the provided arguments.

[
mySpy(
{ foo: 'bar' }, // should equal 'baz'
'baz', // should equal { foo: 'bar' }
'qux',
'quux'
) at theFunction (theFileName:xx:yy)
]
mySpy(
{ foo: 'bar' }, // should equal 'baz'
'baz', // should equal { foo: 'bar' }
'qux',
'quux'
); at theFunction (theFileName:xx:yy)
```

@@ -50,11 +48,9 @@

[
mySpy( { foo: 'bar' }, 'baz', 'qux', 'quux' ) at theFunction (theFileName:xx:yy)
mySpy( { foo: 'bar' }, 'baz', 'qux', 'quux' ) at theFunction (theFileName:xx:yy)
mySpy(
{ foo: 'bar' },
'baz'
// missing: should be truthy
) at theFunction (theFileName:xx:yy)
]
mySpy( { foo: 'bar' }, 'baz', 'qux', 'quux' ); at theFunction (theFileName:xx:yy)
mySpy( { foo: 'bar' }, 'baz', 'qux', 'quux' ); at theFunction (theFileName:xx:yy)
mySpy(
{ foo: 'bar' },
'baz'
// missing: should be truthy
); at theFunction (theFileName:xx:yy)
```

@@ -81,10 +77,8 @@

[
mySpy(
{ foo: 'bar' },
'baz',
'qux',
'quux' // should be removed
) at theFunction (theFileName:xx:yy)
]
mySpy(
{ foo: 'bar' },
'baz',
'qux',
'quux' // should be removed
); at theFunction (theFileName:xx:yy)
```

@@ -114,11 +108,9 @@

[
mySpy( { foo: 'bar' }, 'baz', 'qux' ) at theFunction (theFileName:xx:yy)
mySpy( { foo: 'bar' }, 'baz', 'qux' ) at theFunction (theFileName:xx:yy)
mySpy(
{ foo: 'bar' },
'baz'
// missing: should be truthy
) at theFunction (theFileName:xx:yy)
]
mySpy( { foo: 'bar' }, 'baz', 'qux' ); at theFunction (theFileName:xx:yy)
mySpy( { foo: 'bar' }, 'baz', 'qux' ); at theFunction (theFileName:xx:yy)
mySpy(
{ foo: 'bar' },
'baz'
// missing: should be truthy
); at theFunction (theFileName:xx:yy)
```

@@ -36,5 +36,3 @@ Passes if spy was called at least once.

[
add( 42, 42 ) at theFunction (theFileName:xx:yy) // should be removed
]
add( 42, 42 ); at theFunction (theFileName:xx:yy) // should be removed
```

@@ -29,3 +29,3 @@ Passes if a certain `spyCall` satisfies a given spec:

```output
expected decrement( 200 ) at theFunction (theFileName:xx:yy)
expected decrement( 200 ); at theFunction (theFileName:xx:yy)
to satisfy { args: [ 20 ] }

@@ -35,3 +35,3 @@

200 // should equal 20
) at theFunction (theFileName:xx:yy)
); at theFunction (theFileName:xx:yy)
```

@@ -38,0 +38,0 @@

@@ -91,6 +91,6 @@ /*global location*/

prefix: function (output, value) {
return output;
return output.text('(');
},
suffix: function (output) {
return output;
return output.text(');');
}

@@ -107,6 +107,5 @@ });

}
return output.appendInspected(value.proxy).text('(');
return output.appendInspected(value.proxy);
},
suffix: function (output, value) {
output.text(')');
var stackFrames = value.getStackFrames && value.getStackFrames();

@@ -139,2 +138,8 @@ if (Array.isArray(stackFrames) && stackFrames.length > 0) {

base: 'array-like',
prefix: function (output) {
return output;
},
suffix: function (output) {
return output;
},
delimiter: function (output) {

@@ -150,12 +155,9 @@ return output;

},
indent: false,
forceMultipleLines: true,
inspect: function (spyCalls, depth, output, inspect) {
this.prefix(output);
output.nl()
.indentLines()
.i().block(function (output) {
output
.block(function (output) {
output.appendItems(spyCalls, '\n');
})
.nl()
.outdentLines();
this.suffix(output);
});
}

@@ -483,3 +485,3 @@ });

if (expect.flags.always) {
return expect(calls, 'to have items satisfying', 'was called on', target);
return expect(calls, 'to have items satisfying was called on', target);
} else {

@@ -497,3 +499,3 @@ var promises = calls.map(function (call) {

if (failed) {
return expect(calls, 'to have items satisfying', 'was called on', target);
return expect(calls, 'to have items satisfying was called on', target);
}

@@ -556,3 +558,3 @@ });

if (failed) {
return expect(calls, 'to have items satisfying', 'not to satisfy', { args: args });
return expect(calls, 'to have items satisfying not to satisfy', { args: args });
}

@@ -570,3 +572,3 @@ });

var args = [calls, 'to have items satisfying', 'threw'];
var args = [calls, 'to have items satisfying threw'];
if (value) {

@@ -573,0 +575,0 @@ args.push(value);

{
"name": "unexpected-sinon",
"version": "9.1.0",
"version": "10.0.0",
"author": "Sune Sloth Simonsen <sune@we-knowhow.dk>",

@@ -32,3 +32,3 @@ "keywords": [

"sinon": "*",
"unexpected": "10"
"unexpected": "^10.6.0"
},

@@ -42,5 +42,5 @@ "devDependencies": {

"sinon": "1.16.1",
"unexpected": "10.5.1",
"unexpected": "10.6.0",
"unexpected-documentation-site-generator": "^3.3.1"
}
}

@@ -45,7 +45,5 @@ /*global unexpected*/

"\n" +
"[\n" +
" foo() at theFunction (theFileName:xx:yy) // spy: expected foo to be bar\n" +
" bar() at theFunction (theFileName:xx:yy) // spy: expected bar to be foo\n" +
" baz() at theFunction (theFileName:xx:yy)\n" +
"]"
"foo(); at theFunction (theFileName:xx:yy) // spy: expected foo to be bar\n" +
"bar(); at theFunction (theFileName:xx:yy) // spy: expected bar to be foo\n" +
"baz(); at theFunction (theFileName:xx:yy)"
);

@@ -77,7 +75,5 @@ }

"\n" +
"[\n" +
" spy1() at theFunction (theFileName:xx:yy)\n" +
" spy2() at theFunction (theFileName:xx:yy)\n" +
" spy1() at theFunction (theFileName:xx:yy) // spy: expected spy1 to be spy2\n" +
"]"
"spy1(); at theFunction (theFileName:xx:yy)\n" +
"spy2(); at theFunction (theFileName:xx:yy)\n" +
"spy1(); at theFunction (theFileName:xx:yy) // spy: expected spy1 to be spy2"
);

@@ -149,21 +145,19 @@ }

"\n" +
"[\n" +
" increment(\n" +
" 456 // should equal 123\n" +
" ) at theFunction (theFileName:xx:yy)\n" +
" noop( 987 ) at theFunction (theFileName:xx:yy)\n" +
" increment( 123 ) at theFunction (theFileName:xx:yy)\n" +
" // returned: expected 124 to equal 557\n" +
" noop( 555 ) at theFunction (theFileName:xx:yy)\n" +
" increment( 666 ) at theFunction (theFileName:xx:yy)\n" +
" // threw: expected Error('No, I won\\'t do that')\n" +
" // to satisfy { message: expect.it('not to match', /^No/) }\n" +
" //\n" +
" // {\n" +
" // message: 'No, I won\\'t do that' // should not match /^No/\n" +
" // //\n" +
" // // No, I won't do that\n" +
" // // ^^\n" +
" // }\n" +
"]"
"increment(\n" +
" 456 // should equal 123\n" +
"); at theFunction (theFileName:xx:yy)\n" +
"noop( 987 ); at theFunction (theFileName:xx:yy)\n" +
"increment( 123 ); at theFunction (theFileName:xx:yy)\n" +
" // returned: expected 124 to equal 557\n" +
"noop( 555 ); at theFunction (theFileName:xx:yy)\n" +
"increment( 666 ); at theFunction (theFileName:xx:yy)\n" +
" // threw: expected Error('No, I won\\'t do that')\n" +
" // to satisfy { message: expect.it('not to match', /^No/) }\n" +
" //\n" +
" // {\n" +
" // message: 'No, I won\\'t do that' // should not match /^No/\n" +
" // //\n" +
" // // No, I won't do that\n" +
" // // ^^\n" +
" // }"
);

@@ -193,10 +187,8 @@ }

"\n" +
"[\n" +
" mySpy(\n" +
" {\n" +
" foo: 123,\n" +
" bar: 456 // should be removed\n" +
" }\n" +
" ) at theFunction (theFileName:xx:yy)\n" +
"]"
"mySpy(\n" +
" {\n" +
" foo: 123,\n" +
" bar: 456 // should be removed\n" +
" }\n" +
"); at theFunction (theFileName:xx:yy)"
);

@@ -241,17 +233,13 @@ }

"expected [ spy1, spy2 ] to have calls satisfying\n" +
"[\n" +
" spy1( 123 )\n" +
" spy2( 456 )\n" +
" spy1( expect.it('to be a string') )\n" +
" spy2( 789 )\n" +
"]\n" +
"spy1( 123 );\n" +
"spy2( 456 );\n" +
"spy1( expect.it('to be a string') );\n" +
"spy2( 789 );\n" +
"\n" +
"[\n" +
" spy1( 123 ) at theFunction (theFileName:xx:yy)\n" +
" spy2( 456 ) at theFunction (theFileName:xx:yy)\n" +
" spy1(\n" +
" false // should be a string\n" +
" ) at theFunction (theFileName:xx:yy)\n" +
" spy2( 789 ) at theFunction (theFileName:xx:yy)\n" +
"]"
"spy1( 123 ); at theFunction (theFileName:xx:yy)\n" +
"spy2( 456 ); at theFunction (theFileName:xx:yy)\n" +
"spy1(\n" +
" false // should be a string\n" +
"); at theFunction (theFileName:xx:yy)\n" +
"spy2( 789 ); at theFunction (theFileName:xx:yy)"
);

@@ -310,8 +298,6 @@ }

"\n" +
"[\n" +
" myStub() at theFunction (theFileName:xx:yy)\n" +
" // expected: threw /waat/\n" +
" // expected TypeError('wat') to satisfy /waat/\n" +
" myStub() at theFunction (theFileName:xx:yy)\n" +
"]"
"myStub(); at theFunction (theFileName:xx:yy)\n" +
"// expected: threw /waat/\n" +
"// expected TypeError('wat') to satisfy /waat/\n" +
"myStub(); at theFunction (theFileName:xx:yy)"
);

@@ -359,9 +345,7 @@ }

"\n" +
"[\n" +
" increment( 42 ) at theFunction (theFileName:xx:yy)\n" +
" increment(\n" +
" 46, // should equal 20\n" +
" 'yadda' // should be removed\n" +
" ) at theFunction (theFileName:xx:yy)\n" +
"]"
"increment( 42 ); at theFunction (theFileName:xx:yy)\n" +
"increment(\n" +
" 46, // should equal 20\n" +
" 'yadda' // should be removed\n" +
"); at theFunction (theFileName:xx:yy)"
);

@@ -391,10 +375,8 @@ }

"\n" +
"[\n" +
" mySpy(\n" +
" {\n" +
" foo: 123,\n" +
" bar: 456 // should be removed\n" +
" }\n" +
" ) at theFunction (theFileName:xx:yy)\n" +
"]"
"mySpy(\n" +
" {\n" +
" foo: 123,\n" +
" bar: 456 // should be removed\n" +
" }\n" +
"); at theFunction (theFileName:xx:yy)"
);

@@ -429,12 +411,8 @@ }

"expected increment to have calls satisfying\n" +
"[\n" +
" increment( 1 )\n" +
" increment( expect.it('to be a number') )\n" +
"]\n" +
"increment( 1 );\n" +
"increment( expect.it('to be a number') );\n" +
"\n" +
"[\n" +
" increment( 1 ) at theFunction (theFileName:xx:yy)\n" +
" increment( 2 ) at theFunction (theFileName:xx:yy)\n" +
" increment( 3 ) at theFunction (theFileName:xx:yy) // should be removed\n" +
"]"
"increment( 1 ); at theFunction (theFileName:xx:yy)\n" +
"increment( 2 ); at theFunction (theFileName:xx:yy)\n" +
"increment( 3 ); at theFunction (theFileName:xx:yy) // should be removed"
);

@@ -464,7 +442,5 @@ }

"\n" +
"[\n" +
" mySpy() at theFunction (theFileName:xx:yy)\n" +
" // expected: was called on {}\n" +
" // expected mySpy to be called with {} as this but was called with { spy: mySpy }\n" +
"]"
"mySpy(); at theFunction (theFileName:xx:yy)\n" +
"// expected: was called on {}\n" +
"// expected mySpy to be called with {} as this but was called with { spy: mySpy }"
);

@@ -488,8 +464,6 @@ }

"\n" +
"[\n" +
" mySpy() at theFunction (theFileName:xx:yy)\n" +
" mySpy() at theFunction (theFileName:xx:yy)\n" +
" // expected: was called on { spy: mySpy }\n" +
" // expected mySpy to be called with { spy: mySpy } as this but was called with {}\n" +
"]"
"mySpy(); at theFunction (theFileName:xx:yy)\n" +
"mySpy(); at theFunction (theFileName:xx:yy)\n" +
"// expected: was called on { spy: mySpy }\n" +
"// expected mySpy to be called with { spy: mySpy } as this but was called with {}"
);

@@ -529,8 +503,6 @@ }

" expected\n" +
" [\n" +
" add( 41, 42 ) at theFunction (theFileName:xx:yy)\n" +
" add( 41, 43 ) at theFunction (theFileName:xx:yy)\n" +
" add( 41, 44 ) at theFunction (theFileName:xx:yy)\n" +
" add( 41, 45 ) at theFunction (theFileName:xx:yy)\n" +
" ]\n" +
" add( 41, 42 ); at theFunction (theFileName:xx:yy)\n" +
" add( 41, 43 ); at theFunction (theFileName:xx:yy)\n" +
" add( 41, 44 ); at theFunction (theFileName:xx:yy)\n" +
" add( 41, 45 ); at theFunction (theFileName:xx:yy)\n" +
" to have length 2\n" +

@@ -568,10 +540,8 @@ " expected 4 to be 2"

"\n" +
"[\n" +
" mySpy(\n" +
" { foo: 'bar' }, // should equal 'baz'\n" +
" 'baz', // should equal { foo: 'bar' }\n" +
" 'qux',\n" +
" 'quux'\n" +
" ) at theFunction (theFileName:xx:yy)\n" +
"]"
"mySpy(\n" +
" { foo: 'bar' }, // should equal 'baz'\n" +
" 'baz', // should equal { foo: 'bar' }\n" +
" 'qux',\n" +
" 'quux'\n" +
"); at theFunction (theFileName:xx:yy)"
);

@@ -599,11 +569,9 @@ }

"\n" +
"[\n" +
" mySpy( { foo: 'bar' }, 'baz', 'qux', 'quux' ) at theFunction (theFileName:xx:yy)\n" +
" mySpy( { foo: 'bar' }, 'baz', 'qux', 'quux' ) at theFunction (theFileName:xx:yy)\n" +
" mySpy(\n" +
" { foo: 'bar' },\n" +
" 'baz'\n" +
" // missing: should be truthy\n" +
" ) at theFunction (theFileName:xx:yy)\n" +
"]"
"mySpy( { foo: 'bar' }, 'baz', 'qux', 'quux' ); at theFunction (theFileName:xx:yy)\n" +
"mySpy( { foo: 'bar' }, 'baz', 'qux', 'quux' ); at theFunction (theFileName:xx:yy)\n" +
"mySpy(\n" +
" { foo: 'bar' },\n" +
" 'baz'\n" +
" // missing: should be truthy\n" +
"); at theFunction (theFileName:xx:yy)"
);

@@ -628,10 +596,8 @@ }

"\n" +
"[\n" +
" mySpy(\n" +
" { foo: 'bar' },\n" +
" 'baz',\n" +
" 'qux',\n" +
" 'quux' // should be removed\n" +
" ) at theFunction (theFileName:xx:yy)\n" +
"]"
"mySpy(\n" +
" { foo: 'bar' },\n" +
" 'baz',\n" +
" 'qux',\n" +
" 'quux' // should be removed\n" +
"); at theFunction (theFileName:xx:yy)"
);

@@ -659,11 +625,9 @@ }

"\n" +
"[\n" +
" mySpy( { foo: 'bar' }, 'baz', 'qux' ) at theFunction (theFileName:xx:yy)\n" +
" mySpy( { foo: 'bar' }, 'baz', 'qux' ) at theFunction (theFileName:xx:yy)\n" +
" mySpy(\n" +
" { foo: 'bar' },\n" +
" 'baz'\n" +
" // missing: should be truthy\n" +
" ) at theFunction (theFileName:xx:yy)\n" +
"]"
"mySpy( { foo: 'bar' }, 'baz', 'qux' ); at theFunction (theFileName:xx:yy)\n" +
"mySpy( { foo: 'bar' }, 'baz', 'qux' ); at theFunction (theFileName:xx:yy)\n" +
"mySpy(\n" +
" { foo: 'bar' },\n" +
" 'baz'\n" +
" // missing: should be truthy\n" +
"); at theFunction (theFileName:xx:yy)"
);

@@ -710,5 +674,3 @@ }

"\n" +
"[\n" +
" add( 42, 42 ) at theFunction (theFileName:xx:yy) // should be removed\n" +
"]"
"add( 42, 42 ); at theFunction (theFileName:xx:yy) // should be removed"
);

@@ -755,3 +717,3 @@ }

expect(e, "to have message",
"expected decrement( 200 ) at theFunction (theFileName:xx:yy)\n" +
"expected decrement( 200 ); at theFunction (theFileName:xx:yy)\n" +
"to satisfy { args: [ 20 ] }\n" +

@@ -761,3 +723,3 @@ "\n" +

" 200 // should equal 20\n" +
") at theFunction (theFileName:xx:yy)"
"); at theFunction (theFileName:xx:yy)"
);

@@ -764,0 +726,0 @@ }

@@ -37,6 +37,4 @@ /*global describe, it, beforeEach, sinon, unexpected*/

"\n" +
"[\n" +
" spy1( 42, { foo: 'bar' } ) at theFunction (theFileName:xx:yy) // should be removed\n" +
" spy1( 'baz' ) at theFunction (theFileName:xx:yy) // should be removed\n" +
"]"
"spy1( 42, { foo: 'bar' } ); at theFunction (theFileName:xx:yy) // should be removed\n" +
"spy1( 'baz' ); at theFunction (theFileName:xx:yy) // should be removed"
);

@@ -64,6 +62,4 @@ });

" expected\n" +
" [\n" +
" spy1( 42, { foo: 'bar' } ) at theFunction (theFileName:xx:yy)\n" +
" spy1( 'baz' ) at theFunction (theFileName:xx:yy)\n" +
" ]\n" +
" spy1( 42, { foo: 'bar' } ); at theFunction (theFileName:xx:yy)\n" +
" spy1( 'baz' ); at theFunction (theFileName:xx:yy)\n" +
" to have length 1\n" +

@@ -92,7 +88,3 @@ " expected 2 to be 1"

}, "to throw exception", "expected spy1 was called twice\n" +
" expected\n" +
" [\n" +
" spy1() at theFunction (theFileName:xx:yy)\n" +
" ]\n" +
" to have length 2\n" +
" expected spy1(); at theFunction (theFileName:xx:yy) to have length 2\n" +
" expected 1 to be 2"

@@ -108,7 +100,5 @@ );

" expected\n" +
" [\n" +
" spy1() at theFunction (theFileName:xx:yy)\n" +
" spy1( 42 ) at theFunction (theFileName:xx:yy)\n" +
" spy1() at theFunction (theFileName:xx:yy)\n" +
" ]\n" +
" spy1(); at theFunction (theFileName:xx:yy)\n" +
" spy1( 42 ); at theFunction (theFileName:xx:yy)\n" +
" spy1(); at theFunction (theFileName:xx:yy)\n" +
" to have length 2\n" +

@@ -137,6 +127,4 @@ " expected 3 to be 2"

" expected\n" +
" [\n" +
" spy1() at theFunction (theFileName:xx:yy)\n" +
" spy1() at theFunction (theFileName:xx:yy)\n" +
" ]\n" +
" spy1(); at theFunction (theFileName:xx:yy)\n" +
" spy1(); at theFunction (theFileName:xx:yy)\n" +
" to have length 3\n" +

@@ -153,8 +141,6 @@ " expected 2 to be 3"

" expected\n" +
" [\n" +
" spy1() at theFunction (theFileName:xx:yy)\n" +
" spy1() at theFunction (theFileName:xx:yy)\n" +
" spy1() at theFunction (theFileName:xx:yy)\n" +
" spy1() at theFunction (theFileName:xx:yy)\n" +
" ]\n" +
" spy1(); at theFunction (theFileName:xx:yy)\n" +
" spy1(); at theFunction (theFileName:xx:yy)\n" +
" spy1(); at theFunction (theFileName:xx:yy)\n" +
" spy1(); at theFunction (theFileName:xx:yy)\n" +
" to have length 3\n" +

@@ -182,6 +168,4 @@ " expected 4 to be 3"

" expected\n" +
" [\n" +
" spy1() at theFunction (theFileName:xx:yy)\n" +
" spy1() at theFunction (theFileName:xx:yy)\n" +
" ]\n" +
" spy1(); at theFunction (theFileName:xx:yy)\n" +
" spy1(); at theFunction (theFileName:xx:yy)\n" +
" to have length 3\n" +

@@ -201,8 +185,6 @@ " expected 2 to be 3"

" expected\n" +
" [\n" +
" spy1() at theFunction (theFileName:xx:yy)\n" +
" spy1() at theFunction (theFileName:xx:yy)\n" +
" spy1() at theFunction (theFileName:xx:yy)\n" +
" spy1() at theFunction (theFileName:xx:yy)\n" +
" ]\n" +
" spy1(); at theFunction (theFileName:xx:yy)\n" +
" spy1(); at theFunction (theFileName:xx:yy)\n" +
" spy1(); at theFunction (theFileName:xx:yy)\n" +
" spy1(); at theFunction (theFileName:xx:yy)\n" +
" to have length 3\n" +

@@ -269,10 +251,8 @@ " expected 4 to be 3"

"\n" +
"[\n" +
" agent005() at theFunction (theFileName:xx:yy)\n" +
" agent006() at theFunction (theFileName:xx:yy)\n" +
" agent007() at theFunction (theFileName:xx:yy)\n" +
" agent005() at theFunction (theFileName:xx:yy)\n" +
" agent006() at theFunction (theFileName:xx:yy)\n" +
" agent007() at theFunction (theFileName:xx:yy) // spy: expected agent007 to be agent005\n" +
"]"
"agent005(); at theFunction (theFileName:xx:yy)\n" +
"agent006(); at theFunction (theFileName:xx:yy)\n" +
"agent007(); at theFunction (theFileName:xx:yy)\n" +
"agent005(); at theFunction (theFileName:xx:yy)\n" +
"agent006(); at theFunction (theFileName:xx:yy)\n" +
"agent007(); at theFunction (theFileName:xx:yy) // spy: expected agent007 to be agent005"
);

@@ -293,7 +273,5 @@ });

"\n" +
"[\n" +
" agent005() at theFunction (theFileName:xx:yy)\n" +
" agent007() at theFunction (theFileName:xx:yy) // spy: expected agent007 to be agent006\n" +
" agent006() at theFunction (theFileName:xx:yy) // spy: expected agent006 to be agent007\n" +
"]"
"agent005(); at theFunction (theFileName:xx:yy)\n" +
"agent007(); at theFunction (theFileName:xx:yy) // spy: expected agent007 to be agent006\n" +
"agent006(); at theFunction (theFileName:xx:yy) // spy: expected agent006 to be agent007"
);

@@ -313,7 +291,5 @@ });

"\n" +
"[\n" +
" agent005() at theFunction (theFileName:xx:yy)\n" +
" agent006() at theFunction (theFileName:xx:yy)\n" +
" // missing { spy: agent007 }\n" +
"]"
"agent005(); at theFunction (theFileName:xx:yy)\n" +
"agent006(); at theFunction (theFileName:xx:yy)\n" +
"// missing { spy: agent007 }"
);

@@ -381,8 +357,6 @@ });

"\n" +
"[\n" +
" spy1() at theFunction (theFileName:xx:yy)\n" +
" spy1() at theFunction (theFileName:xx:yy)\n" +
" // expected: was called on { spy: spy1 }\n" +
" // expected spy1 to be called with { spy: spy1 } as this but was called with null\n" +
"]"
"spy1(); at theFunction (theFileName:xx:yy)\n" +
"spy1(); at theFunction (theFileName:xx:yy)\n" +
"// expected: was called on { spy: spy1 }\n" +
"// expected spy1 to be called with { spy: spy1 } as this but was called with null"
);

@@ -413,14 +387,12 @@ });

"\n" +
"[\n" +
" spy1(\n" +
" {\n" +
" foo: 'baa' // should equal 'bar'\n" +
" // -baa\n" +
" // +bar\n" +
" },\n" +
" 'baz',\n" +
" true,\n" +
" false\n" +
" ) at theFunction (theFileName:xx:yy)\n" +
"]"
"spy1(\n" +
" {\n" +
" foo: 'baa' // should equal 'bar'\n" +
" // -baa\n" +
" // +bar\n" +
" },\n" +
" 'baz',\n" +
" true,\n" +
" false\n" +
"); at theFunction (theFileName:xx:yy)"
);

@@ -445,10 +417,8 @@ });

"\n" +
"[\n" +
" spy1(\n" +
" 'something else' // should equal { foo: 'bar' }\n" +
" // missing 'baz'\n" +
" // missing: should be truthy\n" +
" ) at theFunction (theFileName:xx:yy)\n" +
" spy1( { foo: 'bar' }, 'baz', true, false ) at theFunction (theFileName:xx:yy)\n" +
"]"
"spy1(\n" +
" 'something else' // should equal { foo: 'bar' }\n" +
" // missing 'baz'\n" +
" // missing: should be truthy\n" +
"); at theFunction (theFileName:xx:yy)\n" +
"spy1( { foo: 'bar' }, 'baz', true, false ); at theFunction (theFileName:xx:yy)"
);

@@ -464,9 +434,7 @@ });

"\n" +
"[\n" +
" spy1(\n" +
" 'a',\n" +
" 'b', // should be removed\n" +
" 'c'\n" +
" ) at theFunction (theFileName:xx:yy)\n" +
"]"
"spy1(\n" +
" 'a',\n" +
" 'b', // should be removed\n" +
" 'c'\n" +
"); at theFunction (theFileName:xx:yy)"
);

@@ -482,9 +450,7 @@ });

"\n" +
"[\n" +
" spy1(\n" +
" 'a',\n" +
" // missing 'b'\n" +
" 'c'\n" +
" ) at theFunction (theFileName:xx:yy)\n" +
"]"
"spy1(\n" +
" 'a',\n" +
" // missing 'b'\n" +
" 'c'\n" +
"); at theFunction (theFileName:xx:yy)"
);

@@ -507,6 +473,4 @@ });

"\n" +
"[\n" +
" spy1( 'bar', 'true' ) at theFunction (theFileName:xx:yy)\n" +
" // should not satisfy { args: { 0: 'bar', 1: expect.it('to be truthy') } }\n" +
"]"
"spy1( 'bar', 'true' ); at theFunction (theFileName:xx:yy)\n" +
"// should not satisfy { args: { 0: 'bar', 1: expect.it('to be truthy') } }"
);

@@ -523,6 +487,4 @@ });

"\n" +
"[\n" +
" spy1( 'foo' ) at theFunction (theFileName:xx:yy)\n" +
" spy1( 'bar', {} ) at theFunction (theFileName:xx:yy) // should not satisfy { args: { 0: 'bar' } }\n" +
"]"
"spy1( 'foo' ); at theFunction (theFileName:xx:yy)\n" +
"spy1( 'bar', {} ); at theFunction (theFileName:xx:yy) // should not satisfy { args: { 0: 'bar' } }"
);

@@ -546,10 +508,8 @@ });

"\n" +
"[\n" +
" spy1(\n" +
" 'foo',\n" +
" 'bar',\n" +
" 'baz',\n" +
" 'qux' // should be removed\n" +
" ) at theFunction (theFileName:xx:yy)\n" +
"]"
"spy1(\n" +
" 'foo',\n" +
" 'bar',\n" +
" 'baz',\n" +
" 'qux' // should be removed\n" +
"); at theFunction (theFileName:xx:yy)"
);

@@ -574,11 +534,9 @@ });

"\n" +
"[\n" +
" spy1( 'foo', 'bar', 'baz' ) at theFunction (theFileName:xx:yy)\n" +
" spy1(\n" +
" 'foo',\n" +
" 'bar',\n" +
" 'baz',\n" +
" 'qux' // should be removed\n" +
" ) at theFunction (theFileName:xx:yy)\n" +
"]"
"spy1( 'foo', 'bar', 'baz' ); at theFunction (theFileName:xx:yy)\n" +
"spy1(\n" +
" 'foo',\n" +
" 'bar',\n" +
" 'baz',\n" +
" 'qux' // should be removed\n" +
"); at theFunction (theFileName:xx:yy)"
);

@@ -621,13 +579,11 @@ });

"\n" +
"[\n" +
" stub() at theFunction (theFileName:xx:yy) // expected: threw { name: 'TypeError' }\n" +
" // expected Error() to satisfy { name: 'TypeError' }\n" +
" //\n" +
" // {\n" +
" // message: '',\n" +
" // name: 'Error' // should equal 'TypeError'\n" +
" // // -Error\n" +
" // // +TypeError\n" +
" // }\n" +
"]"
"stub(); at theFunction (theFileName:xx:yy) // expected: threw { name: 'TypeError' }\n" +
" // expected Error() to satisfy { name: 'TypeError' }\n" +
" //\n" +
" // {\n" +
" // message: '',\n" +
" // name: 'Error' // should equal 'TypeError'\n" +
" // // -Error\n" +
" // // +TypeError\n" +
" // }"
);

@@ -655,6 +611,4 @@ });

"\n" +
"[\n" +
" stub() at theFunction (theFileName:xx:yy) // expected: threw Error()\n" +
" // expected TypeError() to satisfy Error()\n" +
"]"
"stub(); at theFunction (theFileName:xx:yy) // expected: threw Error()\n" +
" // expected TypeError() to satisfy Error()"
);

@@ -690,6 +644,4 @@ });

"\n" +
"[\n" +
" spy1() at theFunction (theFileName:xx:yy)\n" +
" spy1() at theFunction (theFileName:xx:yy) // expected: threw\n" +
"]"
"spy1(); at theFunction (theFileName:xx:yy)\n" +
"spy1(); at theFunction (theFileName:xx:yy) // expected: threw"
);

@@ -719,14 +671,12 @@ });

"\n" +
"[\n" +
" stub() at theFunction (theFileName:xx:yy)\n" +
" stub() at theFunction (theFileName:xx:yy) // expected: threw { name: 'Error' }\n" +
" // expected TypeError() to satisfy { name: 'Error' }\n" +
" //\n" +
" // {\n" +
" // message: '',\n" +
" // name: 'TypeError' // should equal 'Error'\n" +
" // // -TypeError\n" +
" // // +Error\n" +
" // }\n" +
"]"
"stub(); at theFunction (theFileName:xx:yy)\n" +
"stub(); at theFunction (theFileName:xx:yy) // expected: threw { name: 'Error' }\n" +
" // expected TypeError() to satisfy { name: 'Error' }\n" +
" //\n" +
" // {\n" +
" // message: '',\n" +
" // name: 'TypeError' // should equal 'Error'\n" +
" // // -TypeError\n" +
" // // +Error\n" +
" // }"
);

@@ -758,7 +708,5 @@ });

"\n" +
"[\n" +
" stub() at theFunction (theFileName:xx:yy)\n" +
" stub() at theFunction (theFileName:xx:yy) // expected: threw Error()\n" +
" // expected TypeError() to satisfy Error()\n" +
"]"
"stub(); at theFunction (theFileName:xx:yy)\n" +
"stub(); at theFunction (theFileName:xx:yy) // expected: threw Error()\n" +
" // expected TypeError() to satisfy Error()"
);

@@ -821,18 +769,16 @@ });

"\n" +
"[\n" +
" spy1( 'foo', 'bar' ) at theFunction (theFileName:xx:yy)\n" +
" spy2( 'quux' ) at theFunction (theFileName:xx:yy) // returned: expected 'blah' to equal 'yadda'\n" +
" //\n" +
" // -blah\n" +
" // +yadda\n" +
" die() at theFunction (theFileName:xx:yy) // threw: expected Error('say what') to satisfy /cqwecqw/\n" +
" spy1(\n" +
" 'baz' // should equal 'yadda'\n" +
" //\n" +
" // -baz\n" +
" // +yadda\n" +
" ) at theFunction (theFileName:xx:yy)\n" +
" spy2( 'yadda' ) at theFunction (theFileName:xx:yy) // spy: expected spy2 to be spy1\n" +
" spy1( 'baz' ) at theFunction (theFileName:xx:yy)\n" +
"]"
"spy1( 'foo', 'bar' ); at theFunction (theFileName:xx:yy)\n" +
"spy2( 'quux' ); at theFunction (theFileName:xx:yy) // returned: expected 'blah' to equal 'yadda'\n" +
" //\n" +
" // -blah\n" +
" // +yadda\n" +
"die(); at theFunction (theFileName:xx:yy) // threw: expected Error('say what') to satisfy /cqwecqw/\n" +
"spy1(\n" +
" 'baz' // should equal 'yadda'\n" +
" //\n" +
" // -baz\n" +
" // +yadda\n" +
"); at theFunction (theFileName:xx:yy)\n" +
"spy2( 'yadda' ); at theFunction (theFileName:xx:yy) // spy: expected spy2 to be spy1\n" +
"spy1( 'baz' ); at theFunction (theFileName:xx:yy)"
);

@@ -864,14 +810,12 @@ });

"\n" +
"[\n" +
" spy1(\n" +
"spy1(\n" +
" {\n" +
" foo: 123 // should be removed\n" +
" },\n" +
" [\n" +
" {\n" +
" foo: 123 // should be removed\n" +
" },\n" +
" [\n" +
" {\n" +
" bar: 'quux' // should be removed\n" +
" }\n" +
" ]\n" +
" ) at theFunction (theFileName:xx:yy)\n" +
"]"
" bar: 'quux' // should be removed\n" +
" }\n" +
" ]\n" +
"); at theFunction (theFileName:xx:yy)"
);

@@ -919,20 +863,16 @@ });

"expected [ spy1, spy2 ] to have calls satisfying\n" +
"[\n" +
" spy2( 123, 456 )\n" +
" new spy1( 'abc', false )\n" +
" spy1( -99, Infinity )\n" +
"]\n" +
"spy2( 123, 456 );\n" +
"new spy1( 'abc', false );\n" +
"spy1( -99, Infinity );\n" +
"\n" +
"[\n" +
" spy2(\n" +
" 123,\n" +
" 456,\n" +
" 99 // should be removed\n" +
" ) at theFunction (theFileName:xx:yy)\n" +
" spy1(\n" +
" 'abc',\n" +
" true // should equal false\n" +
" ) at theFunction (theFileName:xx:yy) // calledWithNew: expected false to equal true\n" +
" new spy1( -99, Infinity ) at theFunction (theFileName:xx:yy) // calledWithNew: expected true to equal false\n" +
"]"
"spy2(\n" +
" 123,\n" +
" 456,\n" +
" 99 // should be removed\n" +
"); at theFunction (theFileName:xx:yy)\n" +
"spy1(\n" +
" 'abc',\n" +
" true // should equal false\n" +
"); at theFunction (theFileName:xx:yy) // calledWithNew: expected false to equal true\n" +
"new spy1( -99, Infinity ); at theFunction (theFileName:xx:yy) // calledWithNew: expected true to equal false"
);

@@ -951,11 +891,7 @@ });

"expected spy1 to have calls satisfying\n" +
"[\n" +
" spy1( 'abc', true )\n" +
" spy1( 'def', false )\n" +
"]\n" +
"spy1( 'abc', true );\n" +
"spy1( 'def', false );\n" +
"\n" +
"[\n" +
" spy1( 'abc', true ) at theFunction (theFileName:xx:yy)\n" +
" // missing spy1( 'def', false )\n" +
"]"
"spy1( 'abc', true ); at theFunction (theFileName:xx:yy)\n" +
"// missing spy1( 'def', false );"
);

@@ -974,11 +910,7 @@ });

"expected spy1 to have calls satisfying\n" +
"[\n" +
" spy1( 'def', false )\n" +
" spy1( 'abc', true )\n" +
"]\n" +
"spy1( 'def', false );\n" +
"spy1( 'abc', true );\n" +
"\n" +
"[\n" +
" // missing spy1( 'def', false )\n" +
" spy1( 'abc', true ) at theFunction (theFileName:xx:yy)\n" +
"]"
"// missing spy1( 'def', false );\n" +
"spy1( 'abc', true ); at theFunction (theFileName:xx:yy)"
);

@@ -1001,15 +933,11 @@ });

"expected spy1 to have calls satisfying\n" +
"[\n" +
" spy1( 123, 456 )\n" +
" spy1( false )\n" +
" spy1( 234 )\n" +
" spy1( 987 )\n" +
"]\n" +
"spy1( 123, 456 );\n" +
"spy1( false );\n" +
"spy1( 234 );\n" +
"spy1( 987 );\n" +
"\n" +
"[\n" +
" spy1( 123, 456 ) at theFunction (theFileName:xx:yy)\n" +
" // missing spy1( false )\n" +
" spy1( 234 ) at theFunction (theFileName:xx:yy)\n" +
" spy1( 987 ) at theFunction (theFileName:xx:yy)\n" +
"]"
"spy1( 123, 456 ); at theFunction (theFileName:xx:yy)\n" +
"// missing spy1( false );\n" +
"spy1( 234 ); at theFunction (theFileName:xx:yy)\n" +
"spy1( 987 ); at theFunction (theFileName:xx:yy)"
);

@@ -1032,18 +960,14 @@ });

"expected spy1 to have calls satisfying\n" +
"[\n" +
" spy1( 123, 456 )\n" +
" spy1( { foo: 456 } )\n" +
" spy1( 987 )\n" +
"]\n" +
"spy1( 123, 456 );\n" +
"spy1( { foo: 456 } );\n" +
"spy1( 987 );\n" +
"\n" +
"[\n" +
" spy1( 123, 456 ) at theFunction (theFileName:xx:yy)\n" +
" spy1(\n" +
" {\n" +
" foo: 123 // should equal 456\n" +
" }\n" +
" ) at theFunction (theFileName:xx:yy)\n" +
" spy1( 456 ) at theFunction (theFileName:xx:yy) // should be removed\n" +
" spy1( 987 ) at theFunction (theFileName:xx:yy)\n" +
"]"
"spy1( 123, 456 ); at theFunction (theFileName:xx:yy)\n" +
"spy1(\n" +
" {\n" +
" foo: 123 // should equal 456\n" +
" }\n" +
"); at theFunction (theFileName:xx:yy)\n" +
"spy1( 456 ); at theFunction (theFileName:xx:yy) // should be removed\n" +
"spy1( 987 ); at theFunction (theFileName:xx:yy)"
);

@@ -1063,21 +987,17 @@ });

"expected spy1 to have calls satisfying\n" +
"[\n" +
" spy1( 'abc', expect.it('to be true') )\n" +
" spy1(\n" +
" 'abc',\n" +
" false,\n" +
" expect.it('to be a number')\n" +
" .and('to be less than', 100)\n" +
" )\n" +
"]\n" +
"spy1( 'abc', expect.it('to be true') );\n" +
"spy1(\n" +
" 'abc',\n" +
" false,\n" +
" expect.it('to be a number')\n" +
" .and('to be less than', 100)\n" +
");\n" +
"\n" +
"[\n" +
" spy1( 'abc', true ) at theFunction (theFileName:xx:yy)\n" +
" spy1(\n" +
" 'abc',\n" +
" false,\n" +
" 123 // ✓ should be a number and\n" +
" // ⨯ should be less than 100\n" +
" ) at theFunction (theFileName:xx:yy)\n" +
"]"
"spy1( 'abc', true ); at theFunction (theFileName:xx:yy)\n" +
"spy1(\n" +
" 'abc',\n" +
" false,\n" +
" 123 // ✓ should be a number and\n" +
" // ⨯ should be less than 100\n" +
"); at theFunction (theFileName:xx:yy)"
);

@@ -1127,6 +1047,4 @@ });

"\n" +
"[\n" +
" new spy1() at theFunction (theFileName:xx:yy) // calledWithNew: expected true to equal false\n" +
" spy1() at theFunction (theFileName:xx:yy) // calledWithNew: expected false to equal true\n" +
"]"
"new spy1(); at theFunction (theFileName:xx:yy) // calledWithNew: expected true to equal false\n" +
"spy1(); at theFunction (theFileName:xx:yy) // calledWithNew: expected false to equal true"
);

@@ -1133,0 +1051,0 @@ });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc