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

unexpected

Package Overview
Dependencies
Maintainers
2
Versions
330
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unexpected - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

4

lib/unexpected.js

@@ -626,5 +626,5 @@ // Copyright (c) 2013 Sune Simonsen <sune@we-knowhow.dk>

var errors = [];
forEach(getKeys(obj), function (key) {
forEach(getKeys(obj), function (key, index) {
try {
callback(obj[key]);
callback(obj[key], index);
} catch (e) {

@@ -631,0 +631,0 @@ errors.push(' ' + key + ': ' + e.message.replace(/\n/g, '\n '));

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

@@ -5,0 +5,0 @@ "keywords": [

@@ -310,3 +310,3 @@ # Unexpected

```js
expect([0, 1, 2, 3, 4], 'to be an array whose items satisfy', function (item) {
expect([0, 1, 2, 3, 4], 'to be an array whose items satisfy', function (item, index) {
expect(item, 'to be a number');

@@ -313,0 +313,0 @@ });

@@ -678,8 +678,10 @@ /*global describe, it, expect*/

it('asserts that the given callback does not throw for any items in the array', function () {
expect([0,1,2,3], 'to be an array whose items satisfy', function (item) {
expect([0,1,2,3], 'to be an array whose items satisfy', function (item, index) {
expect(item, 'to be a number');
expect(index, 'to be a number');
});
expect(['0','1','2','3'], 'to be an array whose items satisfy', function (item) {
expect(['0','1','2','3'], 'to be an array whose items satisfy', function (item, index) {
expect(item, 'not to be a number');
expect(index, 'to be a number');
});

@@ -694,2 +696,10 @@

it('provides the item index to the callback function', function () {
var arr = ['0','1','2','3'];
expect(arr, 'to be an array whose items satisfy', function (item, index) {
expect(index, 'to be a number');
expect(index, 'to be', arr.indexOf(item));
});
});
it('fails when the assertion fails', function () {

@@ -696,0 +706,0 @@ expect(function () {

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