Package: release.debian.org Severity: normal User: release.debian....@packages.debian.org Usertags: unblock X-Debbugs-Cc: node-interp...@packages.debian.org Control: affects -1 + src:node-interpret
Please unblock package node-interpret [ Reason ] node-interpret uses network for its autopkgtest. Due to upstream changes in some old transpilers, autopkgtest started to fail. The proposed patch only change things in node-interpret test. BTS: #1033816 [ Impact ] No change in installed files, patch changes only node-interpret test. [ Tests ] Broken test on deprecated transpiler are now disabled. [ Risks ] No risk, even if patch is a little big, there is no change in installed files. [ Checklist ] [X] all changes are documented in the d/changelog [X] I reviewed all changes and I approve them [X] attach debdiff against the package in testing [ Changes ] * don't test babel/register and buble/register (Debian uses @babel/register, no more babel/register) * test modules: drop embedded "expect" and add patch to use Debian's node-expect (provided by jest) * lintian-brush: * update lintian tags * update metadata * update debian/watch Cheers, Yadd unblock node-interpret/2.2.0-3
diff --git a/debian/changelog b/debian/changelog index b38fa5c..b5bca67 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,21 @@ +node-interpret (2.2.0-3) unstable; urgency=medium + + * Team upload + + [ lintian-brush ] + * Update lintian override info format in d/source/lintian-overrides + on line 2-4 + * Set upstream metadata fields: Bug-Database, Bug-Submit, Repository-Browse + * Update standards version to 4.6.2, no changes needed + + [ Yadd ] + * Fix filenamemangle + * Add fix for expect 28 and drop embedded "expect" + * Set upstream metadata fields: Repository. + * Drop test on deprecated transpilers (Closes: #1033816) + + -- Yadd <y...@debian.org> Mon, 03 Apr 2023 08:10:46 +0400 + node-interpret (2.2.0-2) unstable; urgency=medium * Team upload diff --git a/debian/control b/debian/control index 2b09242..510057d 100644 --- a/debian/control +++ b/debian/control @@ -20,7 +20,7 @@ Build-Depends: debhelper-compat (= 13) , node-parse-node-version <!nocheck> , node-which-boxed-primitive <!nocheck> , node-which-collection <!nocheck> -Standards-Version: 4.6.0 +Standards-Version: 4.6.2 Vcs-Browser: https://salsa.debian.org/js-team/node-interpret Vcs-Git: https://salsa.debian.org/js-team/node-interpret.git Homepage: https://github.com/tkellen/node-interpret diff --git a/debian/copyright b/debian/copyright index e9d0fe5..b5809a0 100644 --- a/debian/copyright +++ b/debian/copyright @@ -16,10 +16,6 @@ Files: debian/tests/test_modules/* Copyright: 1014-2020 Jordan Harband License: Expat -Files: debian/tests/test_modules/expect/* -Copyright: 2015 Michael Jackson -License: Expat - Files: debian/tests/test_modules/*/node_modules/isarray/* Copyright: 2013 Julian Gruber <jul...@juliangruber.com> License: Expat diff --git a/debian/patches/drop-test-on-deprecated-transpilers.patch b/debian/patches/drop-test-on-deprecated-transpilers.patch new file mode 100644 index 0000000..d9a7cea --- /dev/null +++ b/debian/patches/drop-test-on-deprecated-transpilers.patch @@ -0,0 +1,24 @@ +Description: drop test on deprecated transpilers +Author: Yadd <y...@debian.org> +Bug-Debian: https://bugs.debian.org/1033816 +Forwarded: not-needed +Last-Update: 2023-04-03 + +--- a/test/index.js ++++ b/test/index.js +@@ -126,6 +126,7 @@ + var fixtureDir = path.dirname(fixture); + var idx = attempt.index; + ++ if( name !== 'babel/register' && name !== 'buble/register' ) { + it('can require ' + extension + ' using ' + name + ' (' + idx + ')', function(done) { + var minVersion = minVersions[module]; + +@@ -232,6 +233,7 @@ + } + done(); + }); ++ } + }); + + it('does not error with the .mjs extension', function(done) { diff --git a/debian/patches/fix-for-expect-28.patch b/debian/patches/fix-for-expect-28.patch new file mode 100644 index 0000000..af3bf26 --- /dev/null +++ b/debian/patches/fix-for-expect-28.patch @@ -0,0 +1,15 @@ +Description: add fix for expect 28 (jest) +Author: Yadd <y...@debian.org> +Forwarded: not-needed +Last-Update: 2022-12-01 + +--- a/test/index.js ++++ b/test/index.js +@@ -1,6 +1,6 @@ + 'use strict'; + +-var expect = require('expect'); ++var {expect} = require('expect'); + + var path = require('path'); + var Module = require('module'); diff --git a/debian/patches/series b/debian/patches/series index 0312c9a..7e124d8 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,3 @@ fix-test.diff +fix-for-expect-28.patch +drop-test-on-deprecated-transpilers.patch diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides index 5c71dbd..792e152 100644 --- a/debian/source/lintian-overrides +++ b/debian/source/lintian-overrides @@ -1,4 +1,4 @@ # Test files used only during autopkgtest -source-is-missing debian/tests/test_modules/expect/lib/Expectation.js -source-contains-prebuilt-javascript-object debian/tests/test_modules/expect/lib/Expectation.js -very-long-line-length-in-source-file debian/tests/test_modules/expect/lib/Expectation.js line * +source-is-missing [debian/tests/test_modules/expect/lib/Expectation.js] +source-contains-prebuilt-javascript-object [debian/tests/test_modules/expect/lib/Expectation.js] +very-long-line-length-in-source-file * [debian/tests/test_modules/expect/lib/Expectation.js:*] diff --git a/debian/tests/autopkgtest-pkg-nodejs.conf b/debian/tests/autopkgtest-pkg-nodejs.conf index 8ba326a..4f90a1b 100644 --- a/debian/tests/autopkgtest-pkg-nodejs.conf +++ b/debian/tests/autopkgtest-pkg-nodejs.conf @@ -1,2 +1,2 @@ -extra_depends=mocha, npm, node-tmatch, node-object-inspect, node-debbundle-es-to-primitive, node-shelljs +extra_depends=mocha, npm, node-tmatch, node-object-inspect, node-debbundle-es-to-primitive, node-shelljs, jest extra_restrictions=needs-internet diff --git a/debian/tests/test_modules/expect/lib/Expectation.js b/debian/tests/test_modules/expect/lib/Expectation.js deleted file mode 100644 index fe74a9d..0000000 --- a/debian/tests/test_modules/expect/lib/Expectation.js +++ /dev/null @@ -1,410 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _has = require('has'); - -var _has2 = _interopRequireDefault(_has); - -var _tmatch = require('tmatch'); - -var _tmatch2 = _interopRequireDefault(_tmatch); - -var _assert = require('./assert'); - -var _assert2 = _interopRequireDefault(_assert); - -var _SpyUtils = require('./SpyUtils'); - -var _TestUtils = require('./TestUtils'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/** - * An Expectation is a wrapper around an assertion that allows it to be written - * in a more natural style, without the need to remember the order of arguments. - * This helps prevent you from making mistakes when writing tests. - */ - -var Expectation = function () { - function Expectation(actual) { - _classCallCheck(this, Expectation); - - this.actual = actual; - - if ((0, _TestUtils.isFunction)(actual)) { - this.context = null; - this.args = []; - } - } - - _createClass(Expectation, [{ - key: 'toExist', - value: function toExist(message) { - (0, _assert2.default)(this.actual, message || 'Expected %s to exist', this.actual); - - return this; - } - }, { - key: 'toNotExist', - value: function toNotExist(message) { - (0, _assert2.default)(!this.actual, message || 'Expected %s to not exist', this.actual); - - return this; - } - }, { - key: 'toBe', - value: function toBe(value, message) { - (0, _assert2.default)(this.actual === value, message || 'Expected %s to be %s', this.actual, value); - - return this; - } - }, { - key: 'toNotBe', - value: function toNotBe(value, message) { - (0, _assert2.default)(this.actual !== value, message || 'Expected %s to not be %s', this.actual, value); - - return this; - } - }, { - key: 'toEqual', - value: function toEqual(value, message) { - try { - (0, _assert2.default)((0, _TestUtils.isEqual)(this.actual, value), message || 'Expected %s to equal %s', this.actual, value); - } catch (error) { - // These attributes are consumed by Mocha to produce a diff output. - error.actual = this.actual; - error.expected = value; - error.showDiff = true; - throw error; - } - - return this; - } - }, { - key: 'toNotEqual', - value: function toNotEqual(value, message) { - (0, _assert2.default)(!(0, _TestUtils.isEqual)(this.actual, value), message || 'Expected %s to not equal %s', this.actual, value); - - return this; - } - }, { - key: 'toThrow', - value: function toThrow(value, message) { - (0, _assert2.default)((0, _TestUtils.isFunction)(this.actual), 'The "actual" argument in expect(actual).toThrow() must be a function, %s was given', this.actual); - - (0, _assert2.default)((0, _TestUtils.functionThrows)(this.actual, this.context, this.args, value), message || 'Expected %s to throw %s', this.actual, value || 'an error'); - - return this; - } - }, { - key: 'toNotThrow', - value: function toNotThrow(value, message) { - (0, _assert2.default)((0, _TestUtils.isFunction)(this.actual), 'The "actual" argument in expect(actual).toNotThrow() must be a function, %s was given', this.actual); - - (0, _assert2.default)(!(0, _TestUtils.functionThrows)(this.actual, this.context, this.args, value), message || 'Expected %s to not throw %s', this.actual, value || 'an error'); - - return this; - } - }, { - key: 'toBeA', - value: function toBeA(value, message) { - (0, _assert2.default)((0, _TestUtils.isFunction)(value) || typeof value === 'string', 'The "value" argument in toBeA(value) must be a function or a string'); - - (0, _assert2.default)((0, _TestUtils.isA)(this.actual, value), message || 'Expected %s to be a %s', this.actual, value); - - return this; - } - }, { - key: 'toNotBeA', - value: function toNotBeA(value, message) { - (0, _assert2.default)((0, _TestUtils.isFunction)(value) || typeof value === 'string', 'The "value" argument in toNotBeA(value) must be a function or a string'); - - (0, _assert2.default)(!(0, _TestUtils.isA)(this.actual, value), message || 'Expected %s to not be a %s', this.actual, value); - - return this; - } - }, { - key: 'toMatch', - value: function toMatch(pattern, message) { - (0, _assert2.default)((0, _tmatch2.default)(this.actual, pattern), message || 'Expected %s to match %s', this.actual, pattern); - - return this; - } - }, { - key: 'toNotMatch', - value: function toNotMatch(pattern, message) { - (0, _assert2.default)(!(0, _tmatch2.default)(this.actual, pattern), message || 'Expected %s to not match %s', this.actual, pattern); - - return this; - } - }, { - key: 'toBeLessThan', - value: function toBeLessThan(value, message) { - (0, _assert2.default)(typeof this.actual === 'number', 'The "actual" argument in expect(actual).toBeLessThan() must be a number'); - - (0, _assert2.default)(typeof value === 'number', 'The "value" argument in toBeLessThan(value) must be a number'); - - (0, _assert2.default)(this.actual < value, message || 'Expected %s to be less than %s', this.actual, value); - - return this; - } - }, { - key: 'toBeLessThanOrEqualTo', - value: function toBeLessThanOrEqualTo(value, message) { - (0, _assert2.default)(typeof this.actual === 'number', 'The "actual" argument in expect(actual).toBeLessThanOrEqualTo() must be a number'); - - (0, _assert2.default)(typeof value === 'number', 'The "value" argument in toBeLessThanOrEqualTo(value) must be a number'); - - (0, _assert2.default)(this.actual <= value, message || 'Expected %s to be less than or equal to %s', this.actual, value); - - return this; - } - }, { - key: 'toBeGreaterThan', - value: function toBeGreaterThan(value, message) { - (0, _assert2.default)(typeof this.actual === 'number', 'The "actual" argument in expect(actual).toBeGreaterThan() must be a number'); - - (0, _assert2.default)(typeof value === 'number', 'The "value" argument in toBeGreaterThan(value) must be a number'); - - (0, _assert2.default)(this.actual > value, message || 'Expected %s to be greater than %s', this.actual, value); - - return this; - } - }, { - key: 'toBeGreaterThanOrEqualTo', - value: function toBeGreaterThanOrEqualTo(value, message) { - (0, _assert2.default)(typeof this.actual === 'number', 'The "actual" argument in expect(actual).toBeGreaterThanOrEqualTo() must be a number'); - - (0, _assert2.default)(typeof value === 'number', 'The "value" argument in toBeGreaterThanOrEqualTo(value) must be a number'); - - (0, _assert2.default)(this.actual >= value, message || 'Expected %s to be greater than or equal to %s', this.actual, value); - - return this; - } - }, { - key: 'toInclude', - value: function toInclude(value, compareValues, message) { - if (typeof compareValues === 'string') { - message = compareValues; - compareValues = null; - } - - if (compareValues == null) compareValues = _TestUtils.isEqual; - - var contains = false; - - if ((0, _TestUtils.isArray)(this.actual)) { - contains = (0, _TestUtils.arrayContains)(this.actual, value, compareValues); - } else if ((0, _TestUtils.isObject)(this.actual)) { - contains = (0, _TestUtils.objectContains)(this.actual, value, compareValues); - } else if (typeof this.actual === 'string') { - contains = (0, _TestUtils.stringContains)(this.actual, value); - } else { - (0, _assert2.default)(false, 'The "actual" argument in expect(actual).toInclude() must be an array, object, or a string'); - } - - (0, _assert2.default)(contains, message || 'Expected %s to include %s', this.actual, value); - - return this; - } - }, { - key: 'toExclude', - value: function toExclude(value, compareValues, message) { - if (typeof compareValues === 'string') { - message = compareValues; - compareValues = null; - } - - if (compareValues == null) compareValues = _TestUtils.isEqual; - - var contains = false; - - if ((0, _TestUtils.isArray)(this.actual)) { - contains = (0, _TestUtils.arrayContains)(this.actual, value, compareValues); - } else if ((0, _TestUtils.isObject)(this.actual)) { - contains = (0, _TestUtils.objectContains)(this.actual, value, compareValues); - } else if (typeof this.actual === 'string') { - contains = (0, _TestUtils.stringContains)(this.actual, value); - } else { - (0, _assert2.default)(false, 'The "actual" argument in expect(actual).toExclude() must be an array, object, or a string'); - } - - (0, _assert2.default)(!contains, message || 'Expected %s to exclude %s', this.actual, value); - - return this; - } - }, { - key: 'toIncludeKeys', - value: function toIncludeKeys(keys, comparator, message) { - var _this = this; - - if (typeof comparator === 'string') { - message = comparator; - comparator = null; - } - - if (comparator == null) comparator = _has2.default; - - (0, _assert2.default)(_typeof(this.actual) === 'object', 'The "actual" argument in expect(actual).toIncludeKeys() must be an object, not %s', this.actual); - - (0, _assert2.default)((0, _TestUtils.isArray)(keys), 'The "keys" argument in expect(actual).toIncludeKeys(keys) must be an array, not %s', keys); - - var contains = keys.every(function (key) { - return comparator(_this.actual, key); - }); - - (0, _assert2.default)(contains, message || 'Expected %s to include key(s) %s', this.actual, keys.join(', ')); - - return this; - } - }, { - key: 'toIncludeKey', - value: function toIncludeKey(key) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - return this.toIncludeKeys.apply(this, [[key]].concat(args)); - } - }, { - key: 'toExcludeKeys', - value: function toExcludeKeys(keys, comparator, message) { - var _this2 = this; - - if (typeof comparator === 'string') { - message = comparator; - comparator = null; - } - - if (comparator == null) comparator = _has2.default; - - (0, _assert2.default)(_typeof(this.actual) === 'object', 'The "actual" argument in expect(actual).toExcludeKeys() must be an object, not %s', this.actual); - - (0, _assert2.default)((0, _TestUtils.isArray)(keys), 'The "keys" argument in expect(actual).toIncludeKeys(keys) must be an array, not %s', keys); - - var contains = keys.every(function (key) { - return comparator(_this2.actual, key); - }); - - (0, _assert2.default)(!contains, message || 'Expected %s to exclude key(s) %s', this.actual, keys.join(', ')); - - return this; - } - }, { - key: 'toExcludeKey', - value: function toExcludeKey(key) { - for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - - return this.toExcludeKeys.apply(this, [[key]].concat(args)); - } - }, { - key: 'toHaveBeenCalled', - value: function toHaveBeenCalled(message) { - var spy = this.actual; - - (0, _assert2.default)((0, _SpyUtils.isSpy)(spy), 'The "actual" argument in expect(actual).toHaveBeenCalled() must be a spy'); - - (0, _assert2.default)(spy.calls.length > 0, message || 'spy was not called'); - - return this; - } - }, { - key: 'toHaveBeenCalledWith', - value: function toHaveBeenCalledWith() { - for (var _len3 = arguments.length, expectedArgs = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - expectedArgs[_key3] = arguments[_key3]; - } - - var spy = this.actual; - - (0, _assert2.default)((0, _SpyUtils.isSpy)(spy), 'The "actual" argument in expect(actual).toHaveBeenCalledWith() must be a spy'); - - (0, _assert2.default)(spy.calls.some(function (call) { - return (0, _TestUtils.isEqual)(call.arguments, expectedArgs); - }), 'spy was never called with %s', expectedArgs); - - return this; - } - }, { - key: 'toNotHaveBeenCalled', - value: function toNotHaveBeenCalled(message) { - var spy = this.actual; - - (0, _assert2.default)((0, _SpyUtils.isSpy)(spy), 'The "actual" argument in expect(actual).toNotHaveBeenCalled() must be a spy'); - - (0, _assert2.default)(spy.calls.length === 0, message || 'spy was not supposed to be called'); - - return this; - } - }]); - - return Expectation; -}(); - -var deprecate = function deprecate(fn, message) { - var alreadyWarned = false; - - return function () { - if (!alreadyWarned) { - alreadyWarned = true; - console.warn(message); - } - - for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - args[_key4] = arguments[_key4]; - } - - return fn.apply(this, args); - }; -}; - -Expectation.prototype.withContext = deprecate(function (context) { - (0, _assert2.default)((0, _TestUtils.isFunction)(this.actual), 'The "actual" argument in expect(actual).withContext() must be a function'); - - this.context = context; - - return this; -}, '\nwithContext is deprecated; use a closure instead.\n\n expect(fn).withContext(context).toThrow()\n\nbecomes\n\n expect(() => fn.call(context)).toThrow()\n'); - -Expectation.prototype.withArgs = deprecate(function () { - var _args; - - (0, _assert2.default)((0, _TestUtils.isFunction)(this.actual), 'The "actual" argument in expect(actual).withArgs() must be a function'); - - if (arguments.length) this.args = (_args = this.args).concat.apply(_args, arguments); - - return this; -}, '\nwithArgs is deprecated; use a closure instead.\n\n expect(fn).withArgs(a, b, c).toThrow()\n\nbecomes\n\n expect(() => fn(a, b, c)).toThrow()\n'); - -var aliases = { - toBeAn: 'toBeA', - toNotBeAn: 'toNotBeA', - toBeTruthy: 'toExist', - toBeFalsy: 'toNotExist', - toBeFewerThan: 'toBeLessThan', - toBeMoreThan: 'toBeGreaterThan', - toContain: 'toInclude', - toNotContain: 'toExclude', - toNotInclude: 'toExclude', - toContainKeys: 'toIncludeKeys', - toNotContainKeys: 'toExcludeKeys', - toNotIncludeKeys: 'toExcludeKeys', - toContainKey: 'toIncludeKey', - toNotContainKey: 'toExcludeKey', - toNotIncludeKey: 'toExcludeKey' -}; - -for (var alias in aliases) { - if (aliases.hasOwnProperty(alias)) Expectation.prototype[alias] = Expectation.prototype[aliases[alias]]; -}exports.default = Expectation; \ No newline at end of file diff --git a/debian/tests/test_modules/expect/lib/SpyUtils.js b/debian/tests/test_modules/expect/lib/SpyUtils.js deleted file mode 100644 index c27f07a..0000000 --- a/debian/tests/test_modules/expect/lib/SpyUtils.js +++ /dev/null @@ -1,121 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.spyOn = exports.createSpy = exports.restoreSpies = exports.isSpy = undefined; - -var _defineProperties = require('define-properties'); - -var _assert = require('./assert'); - -var _assert2 = _interopRequireDefault(_assert); - -var _TestUtils = require('./TestUtils'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } /*eslint-disable prefer-rest-params, no-underscore-dangle*/ - - -var noop = function noop() {}; - -var supportsConfigurableFnLength = _defineProperties.supportsDescriptors && Object.getOwnPropertyDescriptor(function () {}, 'length').configurable; - -var isSpy = exports.isSpy = function isSpy(object) { - return object && object.__isSpy === true; -}; - -var spies = []; - -var restoreSpies = exports.restoreSpies = function restoreSpies() { - for (var i = spies.length - 1; i >= 0; i--) { - spies[i].restore(); - }spies = []; -}; - -var createSpy = exports.createSpy = function createSpy(fn) { - var restore = arguments.length <= 1 || arguments[1] === undefined ? noop : arguments[1]; - - if (fn == null) fn = noop; - - (0, _assert2.default)((0, _TestUtils.isFunction)(fn), 'createSpy needs a function'); - - var targetFn = void 0, - thrownValue = void 0, - returnValue = void 0, - spy = void 0; - - function spyLogic() { - spy.calls.push({ - context: this, - arguments: Array.prototype.slice.call(arguments, 0) - }); - - if (targetFn) return targetFn.apply(this, arguments); - - if (thrownValue) throw thrownValue; - - return returnValue; - } - - if (supportsConfigurableFnLength) { - spy = Object.defineProperty(spyLogic, 'length', { value: fn.length, writable: false, enumerable: false, configurable: true }); - } else { - spy = new Function('spy', 'return function(' + // eslint-disable-line no-new-func - [].concat(_toConsumableArray(Array(fn.length))).map(function (_, i) { - return '_' + i; - }).join(',') + ') {\n return spy.apply(this, arguments)\n }')(spyLogic); - } - - spy.calls = []; - - spy.andCall = function (otherFn) { - targetFn = otherFn; - return spy; - }; - - spy.andCallThrough = function () { - return spy.andCall(fn); - }; - - spy.andThrow = function (value) { - thrownValue = value; - return spy; - }; - - spy.andReturn = function (value) { - returnValue = value; - return spy; - }; - - spy.getLastCall = function () { - return spy.calls[spy.calls.length - 1]; - }; - - spy.reset = function () { - spy.calls = []; - }; - - spy.restore = spy.destroy = restore; - - spy.__isSpy = true; - - spies.push(spy); - - return spy; -}; - -var spyOn = exports.spyOn = function spyOn(object, methodName) { - var original = object[methodName]; - - if (!isSpy(original)) { - (0, _assert2.default)((0, _TestUtils.isFunction)(original), 'Cannot spyOn the %s property; it is not a function', methodName); - - object[methodName] = createSpy(original, function () { - object[methodName] = original; - }); - } - - return object[methodName]; -}; \ No newline at end of file diff --git a/debian/tests/test_modules/expect/lib/TestUtils.js b/debian/tests/test_modules/expect/lib/TestUtils.js deleted file mode 100644 index 1e39b92..0000000 --- a/debian/tests/test_modules/expect/lib/TestUtils.js +++ /dev/null @@ -1,146 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.stringContains = exports.objectContains = exports.arrayContains = exports.functionThrows = exports.isA = exports.isObject = exports.isArray = exports.isFunction = exports.isEqual = exports.whyNotEqual = undefined; - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; - -var _isRegex = require('is-regex'); - -var _isRegex2 = _interopRequireDefault(_isRegex); - -var _why = require('is-equal/why'); - -var _why2 = _interopRequireDefault(_why); - -var _objectKeys = require('object-keys'); - -var _objectKeys2 = _interopRequireDefault(_objectKeys); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Returns the reason why the given arguments are not *conceptually* - * equal, if any; the empty string otherwise. - */ -var whyNotEqual = exports.whyNotEqual = function whyNotEqual(a, b) { - return a == b ? '' : (0, _why2.default)(a, b); -}; - -/** - * Returns true if the given arguments are *conceptually* equal. - */ -var isEqual = exports.isEqual = function isEqual(a, b) { - return whyNotEqual(a, b) === ''; -}; - -/** - * Returns true if the given object is a function. - */ -var isFunction = exports.isFunction = function isFunction(object) { - return typeof object === 'function'; -}; - -/** - * Returns true if the given object is an array. - */ -var isArray = exports.isArray = function isArray(object) { - return Array.isArray(object); -}; - -/** - * Returns true if the given object is an object. - */ -var isObject = exports.isObject = function isObject(object) { - return object && !isArray(object) && (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object'; -}; - -/** - * Returns true if the given object is an instanceof value - * or its typeof is the given value. - */ -var isA = exports.isA = function isA(object, value) { - if (isFunction(value)) return object instanceof value; - - if (value === 'array') return Array.isArray(object); - - return (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === value; -}; - -/** - * Returns true if the given function throws the given value - * when invoked. The value may be: - * - * - undefined, to merely assert there was a throw - * - a constructor function, for comparing using instanceof - * - a regular expression, to compare with the error message - * - a string, to find in the error message - */ -var functionThrows = exports.functionThrows = function functionThrows(fn, context, args, value) { - try { - fn.apply(context, args); - } catch (error) { - if (value == null) return true; - - if (isFunction(value) && error instanceof value) return true; - - var message = error.message || error; - - if (typeof message === 'string') { - if ((0, _isRegex2.default)(value) && value.test(error.message)) return true; - - if (typeof value === 'string' && message.indexOf(value) !== -1) return true; - } - } - - return false; -}; - -/** - * Returns true if the given array contains the value, false - * otherwise. The compareValues function must return false to - * indicate a non-match. - */ -var arrayContains = exports.arrayContains = function arrayContains(array, value, compareValues) { - return array.some(function (item) { - return compareValues(item, value) !== false; - }); -}; - -var ownEnumerableKeys = function ownEnumerableKeys(object) { - if ((typeof Reflect === 'undefined' ? 'undefined' : _typeof(Reflect)) === 'object' && typeof Reflect.ownKeys === 'function') { - return Reflect.ownKeys(object).filter(function (key) { - return Object.getOwnPropertyDescriptor(object, key).enumerable; - }); - } - - if (typeof Object.getOwnPropertySymbols === 'function') { - return Object.getOwnPropertySymbols(object).filter(function (key) { - return Object.getOwnPropertyDescriptor(object, key).enumerable; - }).concat((0, _objectKeys2.default)(object)); - } - - return (0, _objectKeys2.default)(object); -}; - -/** - * Returns true if the given object contains the value, false - * otherwise. The compareValues function must return false to - * indicate a non-match. - */ -var objectContains = exports.objectContains = function objectContains(object, value, compareValues) { - return ownEnumerableKeys(value).every(function (k) { - if (isObject(object[k]) && isObject(value[k])) return objectContains(object[k], value[k], compareValues); - - return compareValues(object[k], value[k]); - }); -}; - -/** - * Returns true if the given string contains the value, false otherwise. - */ -var stringContains = exports.stringContains = function stringContains(string, value) { - return string.indexOf(value) !== -1; -}; \ No newline at end of file diff --git a/debian/tests/test_modules/expect/lib/assert.js b/debian/tests/test_modules/expect/lib/assert.js deleted file mode 100644 index 9c1a80c..0000000 --- a/debian/tests/test_modules/expect/lib/assert.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _objectInspect = require('object-inspect'); - -var _objectInspect2 = _interopRequireDefault(_objectInspect); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var formatString = function formatString(string, args) { - var index = 0; - return string.replace(/%s/g, function () { - return (0, _objectInspect2.default)(args[index++]); - }); -}; - -var assert = function assert(condition, createMessage) { - for (var _len = arguments.length, extraArgs = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - extraArgs[_key - 2] = arguments[_key]; - } - - if (condition) return; - - var message = typeof createMessage === 'string' ? formatString(createMessage, extraArgs) : createMessage(extraArgs); - - throw new Error(message); -}; - -exports.default = assert; \ No newline at end of file diff --git a/debian/tests/test_modules/expect/lib/extend.js b/debian/tests/test_modules/expect/lib/extend.js deleted file mode 100644 index 280d3f6..0000000 --- a/debian/tests/test_modules/expect/lib/extend.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _Expectation = require('./Expectation'); - -var _Expectation2 = _interopRequireDefault(_Expectation); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var Extensions = []; - -function extend(extension) { - if (Extensions.indexOf(extension) === -1) { - Extensions.push(extension); - - for (var p in extension) { - if (extension.hasOwnProperty(p)) _Expectation2.default.prototype[p] = extension[p]; - } - } -} - -exports.default = extend; \ No newline at end of file diff --git a/debian/tests/test_modules/expect/lib/index.js b/debian/tests/test_modules/expect/lib/index.js deleted file mode 100644 index 5139296..0000000 --- a/debian/tests/test_modules/expect/lib/index.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -var _Expectation = require('./Expectation'); - -var _Expectation2 = _interopRequireDefault(_Expectation); - -var _SpyUtils = require('./SpyUtils'); - -var _assert = require('./assert'); - -var _assert2 = _interopRequireDefault(_assert); - -var _extend = require('./extend'); - -var _extend2 = _interopRequireDefault(_extend); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function expect(actual) { - return new _Expectation2.default(actual); -} - -expect.createSpy = _SpyUtils.createSpy; -expect.spyOn = _SpyUtils.spyOn; -expect.isSpy = _SpyUtils.isSpy; -expect.restoreSpies = _SpyUtils.restoreSpies; -expect.assert = _assert2.default; -expect.extend = _extend2.default; - -module.exports = expect; \ No newline at end of file diff --git a/debian/tests/test_modules/expect/package.json b/debian/tests/test_modules/expect/package.json deleted file mode 100644 index a0ef0b2..0000000 --- a/debian/tests/test_modules/expect/package.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "_from": "expect@^1.20.2", - "_id": "expect@1.20.2", - "_inBundle": false, - "_integrity": "sha1-1Fj+TFYAQDa64yMkFqP2Nh8E+WU=", - "_location": "/expect", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "expect@^1.20.2", - "name": "expect", - "escapedName": "expect", - "rawSpec": "^1.20.2", - "saveSpec": null, - "fetchSpec": "^1.20.2" - }, - "_requiredBy": [ - "#DEV:/" - ], - "_resolved": "https://registry.npmjs.org/expect/-/expect-1.20.2.tgz", - "_shasum": "d458fe4c56004036bae3232416a3f6361f04f965", - "_spec": "expect@^1.20.2", - "_where": "/home/xavier/dev/debian/src/pkg-js/packages/node-interpret", - "author": { - "name": "Michael Jackson" - }, - "babel": { - "presets": [ - "es2015" - ] - }, - "bugs": { - "url": "https://github.com/mjackson/expect/issues" - }, - "bundleDependencies": false, - "dependencies": { - "define-properties": "~1.1.2", - "has": "^1.0.1", - "is-equal": "^1.5.1", - "is-regex": "^1.0.3", - "object-inspect": "^1.1.0", - "object-keys": "^1.0.9", - "tmatch": "^2.0.1" - }, - "deprecated": false, - "description": "Write better assertions", - "devDependencies": { - "babel-cli": "^6.6.5", - "babel-eslint": "^6.0.0", - "babel-loader": "^6.2.4", - "babel-preset-es2015": "^6.6.0", - "eslint": "^2.5.1", - "eslint-config-airbnb": "^9.0.1", - "eslint-plugin-import": "^1.7.0", - "eslint-plugin-jsx-a11y": "^1.2.0", - "eslint-plugin-react": "^5.1.1", - "gzip-size": "^3.0.0", - "in-publish": "^2.0.0", - "karma": "^0.13.22", - "karma-browserstack-launcher": "^1.0.0", - "karma-chrome-launcher": "^1.0.1", - "karma-mocha": "^1.0.1", - "karma-mocha-reporter": "^2.0.0", - "karma-sourcemap-loader": "^0.3.7", - "karma-webpack": "^1.7.0", - "mocha": "^2.5.3", - "pretty-bytes": "^3.0.1", - "readline-sync": "^1.4.1", - "rimraf": "^2.5.2", - "webpack": "^1.12.14" - }, - "files": [ - "lib", - "umd" - ], - "homepage": "https://github.com/mjackson/expect#readme", - "keywords": [ - "expect", - "assert", - "test", - "spec" - ], - "license": "MIT", - "main": "lib", - "name": "expect", - "repository": { - "type": "git", - "url": "git+https://github.com/mjackson/expect.git" - }, - "scripts": { - "build": "node ./scripts/build.js", - "build-lib": "rimraf lib && babel ./modules -d lib --ignore '__tests__'", - "build-min": "webpack -p modules/index.js umd/expect.min.js", - "build-umd": "webpack modules/index.js umd/expect.js", - "lint": "eslint modules", - "prepublish": "node ./scripts/build.js", - "release": "node ./scripts/release.js", - "test": "npm run lint && karma start" - }, - "version": "1.20.2" -} diff --git a/debian/upstream/metadata b/debian/upstream/metadata index 93ca1fc..20cff16 100644 --- a/debian/upstream/metadata +++ b/debian/upstream/metadata @@ -1,4 +1,4 @@ -Bug-Database: https://github.com/tkellen/node-interpret/issues -Bug-Submit: https://github.com/tkellen/node-interpret/issues/new -Repository: https://github.com/tkellen/node-interpret.git -Repository-Browse: https://github.com/tkellen/node-interpret +Bug-Database: https://github.com/gulpjs/interpret/issues +Bug-Submit: https://github.com/gulpjs/interpret/issues/new +Repository: https://github.com/gulpjs/interpret.git +Repository-Browse: https://github.com/gulpjs/interpret diff --git a/debian/watch b/debian/watch index ce536dd..78ff040 100644 --- a/debian/watch +++ b/debian/watch @@ -2,5 +2,5 @@ version=4 opts=\ ctype=nodejs,\ dversionmangle=auto,\ -filenamemangle=s/.*\/v?([\d\.-]+)\.tar\.gz/node-interpret-$1.tar.gz/ \ +filenamemangle=s/.*?(\d[\d\.-]*@ARCHIVE_EXT@)/node-interpret-$1/ \ https://github.com/gulpjs/interpret/tags .*/archive/.*/v?([\d\.]+).tar.gz