diff -Nru node-assert-1.4.1/assert.js node-assert-1.5.0/assert.js --- node-assert-1.4.1/assert.js 2016-05-31 14:01:50.000000000 +0000 +++ node-assert-1.5.0/assert.js 2019-05-08 13:00:10.000000000 +0000 @@ -1,5 +1,7 @@ 'use strict'; +var objectAssign = require('object-assign'); + // compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js // original notice: @@ -41,6 +43,8 @@ } // based on node assert, original notice: +// NB: The URL to the CommonJS spec is kept just for tradition. +// node-assert has evolved a lot since then, both in API and behavior. // http://wiki.commonjs.org/wiki/Unit_Testing/1.0 // @@ -481,6 +485,18 @@ assert.ifError = function(err) { if (err) throw err; }; +// Expose a strict only variant of assert +function strict(value, message) { + if (!value) fail(value, true, message, '==', strict); +} +assert.strict = objectAssign(strict, assert, { + equal: assert.strictEqual, + deepEqual: assert.deepStrictEqual, + notEqual: assert.notStrictEqual, + notDeepEqual: assert.notDeepStrictEqual +}); +assert.strict.strict = assert.strict; + var objectKeys = Object.keys || function (obj) { var keys = []; for (var key in obj) { diff -Nru node-assert-1.4.1/CHANGELOG.md node-assert-1.5.0/CHANGELOG.md --- node-assert-1.4.1/CHANGELOG.md 1970-01-01 00:00:00.000000000 +0000 +++ node-assert-1.5.0/CHANGELOG.md 2019-05-08 13:00:10.000000000 +0000 @@ -0,0 +1,8 @@ +# assert change log + +All notable changes to this project will be documented in this file. + +This project adheres to [Semantic Versioning](http://semver.org/). + +## 1.5.0 +* Add strict mode APIs. ([@lukechilds](https://github.com/lukechilds) in [#41](https://github.com/browserify/commonjs-assert/pull/41)) diff -Nru node-assert-1.4.1/debian/changelog node-assert-1.5.0/debian/changelog --- node-assert-1.4.1/debian/changelog 2020-02-19 14:51:05.000000000 +0000 +++ node-assert-1.5.0/debian/changelog 2020-12-24 10:13:22.000000000 +0000 @@ -1,3 +1,15 @@ +node-assert (1.5.0-1) unstable; urgency=medium + + * Team upload + * Bump debhelper compatibility level to 13 + * Declare compliance with policy 4.5.1 + * Modernize debian/watch + * Use dh-sequence-nodejs + * New upstream version 1.5.0 + * Add dependency to node-object-assign + + -- Xavier Guimard Thu, 24 Dec 2020 11:13:22 +0100 + node-assert (1.4.1-2) unstable; urgency=medium * Team upload diff -Nru node-assert-1.4.1/debian/control node-assert-1.5.0/debian/control --- node-assert-1.4.1/debian/control 2020-02-19 12:38:35.000000000 +0000 +++ node-assert-1.5.0/debian/control 2020-12-24 10:07:51.000000000 +0000 @@ -3,11 +3,12 @@ Priority: optional Maintainer: Debian Javascript Maintainers Uploaders: Sruthi Chandran -Build-Depends: debhelper-compat (= 12) +Build-Depends: debhelper-compat (= 13) , mocha + , node-object-assign , node-util - , pkg-js-tools (>= 0.9.20~) -Standards-Version: 4.5.0 + , dh-sequence-nodejs +Standards-Version: 4.5.1 Vcs-Browser: https://salsa.debian.org/js-team/node-assert Vcs-Git: https://salsa.debian.org/js-team/node-assert.git Homepage: https://github.com/defunctzombie/commonjs-assert @@ -17,6 +18,7 @@ Package: node-assert Architecture: all Depends: ${misc:Depends} + , node-object-assign , node-util , nodejs Description: simple assertion library for javascript diff -Nru node-assert-1.4.1/debian/rules node-assert-1.5.0/debian/rules --- node-assert-1.4.1/debian/rules 2020-02-19 12:36:59.000000000 +0000 +++ node-assert-1.5.0/debian/rules 2020-12-24 10:05:32.000000000 +0000 @@ -5,4 +5,4 @@ #export DH_VERBOSE=1 %: - dh $@ --with nodejs + dh $@ diff -Nru node-assert-1.4.1/debian/salsa-ci.yml node-assert-1.5.0/debian/salsa-ci.yml --- node-assert-1.4.1/debian/salsa-ci.yml 1970-01-01 00:00:00.000000000 +0000 +++ node-assert-1.5.0/debian/salsa-ci.yml 2020-12-24 10:05:32.000000000 +0000 @@ -0,0 +1,4 @@ +--- +include: + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml diff -Nru node-assert-1.4.1/debian/watch node-assert-1.5.0/debian/watch --- node-assert-1.4.1/debian/watch 2020-02-19 05:35:28.000000000 +0000 +++ node-assert-1.5.0/debian/watch 2020-12-24 10:05:32.000000000 +0000 @@ -1,5 +1,5 @@ -version=3 +version=4 opts=\ -dversionmangle=s/\+(debian|dfsg|ds|deb)(\.\d+)?$//,\ +dversionmangle=auto,\ filenamemangle=s/.*\/v?([\d\.-]+)\.tar\.gz/node-assert-$1.tar.gz/ \ https://github.com/defunctzombie/commonjs-assert/tags .*/archive/v?([\d\.]+).tar.gz diff -Nru node-assert-1.4.1/package.json node-assert-1.5.0/package.json --- node-assert-1.4.1/package.json 2016-05-31 14:01:50.000000000 +0000 +++ node-assert-1.5.0/package.json 2019-05-08 13:00:10.000000000 +0000 @@ -1,17 +1,9 @@ { "name": "assert", - "description": "commonjs assert - node.js api compatible", - "keywords": [ - "assert" - ], - "version": "1.4.1", - "homepage": "https://github.com/defunctzombie/commonjs-assert", - "repository": { - "type": "git", - "url": "git://github.com/defunctzombie/commonjs-assert.git" - }, - "main": "./assert.js", + "description": "The node.js assert module, re-packaged for web browsers.", + "version": "1.5.0", "dependencies": { + "object-assign": "^4.1.1", "util": "0.10.3" }, "devDependencies": { @@ -19,12 +11,22 @@ "zuul": "~3.10.0", "zuul-ngrok": "^4.0.0" }, + "homepage": "https://github.com/browserify/commonjs-assert", + "keywords": [ + "assert", + "browser" + ], "license": "MIT", + "main": "./assert.js", + "repository": { + "type": "git", + "url": "git://github.com/browserify/commonjs-assert.git" + }, "scripts": { - "test-node": "mocha --ui qunit test.js", - "test-browser": "zuul -- test.js", + "browser-local": "zuul --no-coverage --local 8000 -- test.js", "test": "npm run test-node && npm run test-browser", + "test-browser": "zuul -- test.js", "test-native": "TEST_NATIVE=true mocha --ui qunit test.js", - "browser-local": "zuul --no-coverage --local 8000 -- test.js" + "test-node": "mocha --ui qunit test.js" } } diff -Nru node-assert-1.4.1/README.md node-assert-1.5.0/README.md --- node-assert-1.4.1/README.md 2016-05-31 14:01:50.000000000 +0000 +++ node-assert-1.5.0/README.md 2019-05-08 13:00:10.000000000 +0000 @@ -1,10 +1,48 @@ # assert -[![Build Status](https://travis-ci.org/defunctzombie/commonjs-assert.svg?branch=master)](https://travis-ci.org/defunctzombie/commonjs-assert) +[![Build Status](https://travis-ci.org/browserify/commonjs-assert.svg?branch=master)](https://travis-ci.org/browserify/commonjs-assert) -This module is used for writing unit tests for your applications, you can access it with require('assert'). +This module is used for writing unit tests for your applications, you can access it with `require('assert')`. + +It aims to be fully compatibe with the [node.js assert module](http://nodejs.org/api/assert.html), same API and same behavior, just adding support for web browsers. +The API and code may contain traces of the [CommonJS Unit Testing 1.0 spec](http://wiki.commonjs.org/wiki/Unit_Testing/1.0) which they were based on, but both have evolved significantly since then. + +A `strict` and a `legacy` mode exist, while it is recommended to only use `strict mode`. + +## Strict mode + +When using the `strict mode`, any `assert` function will use the equality used in the strict function mode. So `assert.deepEqual()` will, for example, work the same as `assert.deepStrictEqual()`. + +It can be accessed using: + +```js +const assert = require('assert').strict; +``` + +## Legacy mode + +> Deprecated: Use strict mode instead. + +When accessing `assert` directly instead of using the `strict` property, the +[Abstract Equality Comparison](https://tc39.github.io/ecma262/#sec-abstract-equality-comparison) will be used for any function without a +"strict" in its name (e.g. `assert.deepEqual()`). + +It can be accessed using: + +```js +const assert = require('assert'); +``` + +It is recommended to use the `strict mode` instead as the Abstract Equality Comparison can often have surprising results. Especially +in case of `assert.deepEqual()` as the used comparison rules there are very lax. + +E.g. + +```js +// WARNING: This does not throw an AssertionError! +assert.deepEqual(/a/gi, new Date()); +``` -The API is derived from the [commonjs 1.0 unit testing](http://wiki.commonjs.org/wiki/Unit_Testing/1.0) spec and the [node.js assert module](http://nodejs.org/api/assert.html) ## assert.fail(actual, expected, message, operator) Throws an exception that displays the values for actual and expected separated by the provided operator. @@ -21,6 +59,9 @@ ## assert.deepEqual(actual, expected, [message]) Tests for deep equality. +## assert.deepStrictEqual(actual, expected, [message]) +Tests for deep equality, as determined by the strict equality operator ( === ) + ## assert.notDeepEqual(actual, expected, [message]) Tests for any deep inequality. diff -Nru node-assert-1.4.1/test.js node-assert-1.5.0/test.js --- node-assert-1.4.1/test.js 2016-05-31 14:01:50.000000000 +0000 +++ node-assert-1.5.0/test.js 2019-05-08 13:00:10.000000000 +0000 @@ -179,7 +179,7 @@ throw new errorConstructor('test'); } - test('assert - Testing the throwing', function () { + test('assert - testing the throwing', function () { var aethrow = makeBlock(thrower, assert.AssertionError); aethrow = makeBlock(thrower, assert.AssertionError); @@ -247,11 +247,11 @@ assert.ok(threw, 'wrong constructor validation'); }); - test('assert - use a RegExp to validate error message', function () { + test('assert - use a RegExp to validate error message', function () { assert.throws(makeBlock(thrower, TypeError), /test/); }); - test('assert - se a fn to validate error object', function () { + test('assert - use a fn to validate error object', function () { assert.throws(makeBlock(thrower, TypeError), function(err) { if ((err instanceof TypeError) && /test/.test(err)) { return true; @@ -259,7 +259,7 @@ }); }); - test('assert - Make sure deepEqual doesn\'t loop forever on circular refs', function () { + test('assert - make sure deepEqual doesn\'t loop forever on circular refs', function () { var b = {}; b.b = b; @@ -276,7 +276,7 @@ assert.ok(gotError || !equal, gotError ? 'got error': 'are equal'); }); - test('assert - Ensure reflexivity of deepEqual with `arguments` objects', function() { + test('assert - ensure reflexivity of deepEqual with `arguments` objects', function() { var args = (function() { return arguments; })(); assert.throws(makeBlock(assert.deepEqual, [], args), assert.AssertionError); assert.throws(makeBlock(assert.deepEqual, args, []), assert.AssertionError); @@ -342,4 +342,19 @@ assert.equal(e.toString().split('\n')[0], 'AssertionError: oh no'); } }); + + test('assert - strict mode', function () { + var assertStrict = assert.strict; + + assertStrict.throws(makeBlock(assertStrict.equal, 1, true), assertStrict.AssertionError); + assertStrict.notEqual(0, false); + assertStrict.throws(makeBlock(assertStrict.deepEqual, 1, true), assertStrict.AssertionError); + assertStrict.notDeepEqual(0, false); + assertStrict.equal(assertStrict.strict, assertStrict.strict.strict); + assertStrict.equal(assertStrict.equal, assertStrict.strictEqual); + assertStrict.equal(assertStrict.deepEqual, assertStrict.deepStrictEqual); + assertStrict.equal(assertStrict.notEqual, assertStrict.notStrictEqual); + assertStrict.equal(assertStrict.notDeepEqual, assertStrict.notDeepStrictEqual); + assertStrict.equal(Object.keys(assertStrict).length, Object.keys(assert).length); + }); } diff -Nru node-assert-1.4.1/.travis.yml node-assert-1.5.0/.travis.yml --- node-assert-1.4.1/.travis.yml 2016-05-31 14:01:50.000000000 +0000 +++ node-assert-1.5.0/.travis.yml 2019-05-08 13:00:10.000000000 +0000 @@ -1,7 +1,6 @@ language: node_js before_install: - - npm install -g npm@2 - - npm install -g npm + - nvm install-latest-npm matrix: include: - node_js: '0.8'