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.0.12 to 1.0.13

6

lib/unexpected.js

@@ -111,2 +111,8 @@ // Copyright (c) 2013 Sune Simonsen <sune@we-knowhow.dk>

Unexpected.prototype.expect = function (subject, testDescriptionString) {
if (arguments.length < 2) {
throw new Error('The expect functions requires at least two parameters.');
}
if (typeof testDescriptionString !== 'string') {
throw new Error('The expect functions requires second parameter to be a string.');
}
var assertionRule = this.assertions[testDescriptionString];

@@ -113,0 +119,0 @@ if (assertionRule) {

2

package.json
{
"name": "unexpected",
"version": "1.0.12",
"version": "1.0.13",
"author": "Sune Sloth Simonsen <sune@we-knowhow.dk>",

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

@@ -12,2 +12,22 @@ /*global describe, it, expect*/

describe('unexpected', function () {
describe('argument validation', function () {
it('fails when given no parameters', function () {
expect(function () {
expect();
}, 'to throw', 'The expect functions requires at least two parameters.');
});
it('fails when given only one parameter', function () {
expect(function () {
expect({});
}, 'to throw', 'The expect functions requires at least two parameters.');
});
it('fails when the second parameter is not a string', function () {
expect(function () {
expect({}, {});
}, 'to throw', 'The expect functions requires second parameter to be a string.');
});
});
describe('ok/truthy/falsy assertion', function () {

@@ -14,0 +34,0 @@ it('assert that the value is truthy or not', 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