Socket
Socket
Sign inDemoInstall

expect

Package Overview
Dependencies
18
Maintainers
1
Versions
236
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.6.0 to 1.7.0

.jshintrc

4

modules/__tests__/existence-test.js

@@ -16,3 +16,3 @@ var expect = require('../index');

}).toThrow();
expect(function () {

@@ -34,3 +34,3 @@ expect(null).toExist();

}).toThrow();
expect(function () {

@@ -37,0 +37,0 @@ expect({foo: "bar"}).toNotExist();

@@ -53,2 +53,8 @@ var expect = require('../index');

});
it('can be restored', function () {
expect(video.play).toEqual(spy);
spy.restore();
expect(video.play).toNotEqual(spy);
});
});

@@ -55,0 +61,0 @@

@@ -24,3 +24,4 @@ var assert = require('assert');

function arrayContains(array, value, comparator) {
comparator = comparator || assert.deepEqual;
if (comparator == null)
return array.indexOf(value) !== -1;

@@ -266,3 +267,5 @@ return array.some(function (item) {

function spyOn(object, methodName) {
expect(object[methodName]).toBeA(
var original = object[methodName];
expect(original).toBeA(
Function,

@@ -272,4 +275,9 @@ formatString('%s does not have a method named "%s"', inspect(object), methodName)

if (!object[methodName].__isSpy)
object[methodName] = createSpy(object[methodName]);
if (!original.__isSpy) {
var spy = createSpy(original);
spy.restore = function () {
object[methodName] = original;
};
object[methodName] = spy;
}

@@ -281,2 +289,4 @@ return object[methodName];

toBeAn: 'toBeA',
toBeTruthy: 'toExist',
toBeFalsy: 'toNotExist',
toBeFewerThan: 'toBeLessThan',

@@ -283,0 +293,0 @@ toBeMoreThan: 'toBeGreaterThan',

{
"name": "expect",
"version": "1.6.0",
"version": "1.7.0",
"description": "Write better assertions",
"main": "modules/index.js",
"dependencies": {},
"dependencies": {
"assert": "^1.3.0"
},
"devDependencies": {

@@ -8,0 +10,0 @@ "jshint": "^2.5.10",

@@ -22,7 +22,7 @@ [![npm package](https://img.shields.io/npm/v/expect.svg?style=flat-square)](https://www.npmjs.org/package/expect)

Asserts that the given `object` equals `value` using [assert.equal](http://nodejs.org/api/assert.html#assert_assert_equal_actual_expected_message).
Asserts that the given `object` equals `value` using [assert.deepEqual](http://nodejs.org/api/assert.html#assert_assert_deepequal_actual_expected_message).
##### expect(object).toNotEqual(value, [message])
Asserts that the given `object` is not equal to `value` using [assert.notEqual](http://nodejs.org/api/assert.html#assert_assert_notequal_actual_expected_message).
Asserts that the given `object` is not equal to `value` using [assert.notDeepEqual](http://nodejs.org/api/assert.html#assert_assert_notdeepequal_actual_expected_message).

@@ -29,0 +29,0 @@ ##### expect(block).toThrow([error], [message])

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc