From 15e2175b927010657c66f0a30e44f5266147311f Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 19 Sep 2022 16:38:05 -0700 Subject: [PATCH 1/6] [meta] add missing npmrc config --- .npmrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.npmrc b/.npmrc index 175448e1..2a3e4a38 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1,4 @@ package-lock=false save-prefix=~ +allow-same-version=true +message=v%s From 1b3ad2429b553f7e029fe9fd5977b07e76740e42 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sun, 15 Jan 2023 15:23:25 -0800 Subject: [PATCH 2/6] [Dev Deps] update `@ljharb/eslint-config`, `array.prototype.flatmap`, `aud` --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 34c21f74..f5abf1b1 100644 --- a/package.json +++ b/package.json @@ -29,9 +29,9 @@ "through": "~2.3.8" }, "devDependencies": { - "@ljharb/eslint-config": "^21.0.0", - "array.prototype.flatmap": "^1.3.0", - "aud": "^2.0.0", + "@ljharb/eslint-config": "^21.0.1", + "array.prototype.flatmap": "^1.3.1", + "aud": "^2.0.2", "auto-changelog": "^2.4.0", "concat-stream": "^1.6.2", "eclint": "^2.8.1", From 01edce8073efe1134c5fff58638b350afb7c6d22 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sun, 15 Jan 2023 15:24:04 -0800 Subject: [PATCH 3/6] [Deps] update `defined`, `minimist`, `object-inspect`, `string.prototype.trim` --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index f5abf1b1..e049db46 100644 --- a/package.json +++ b/package.json @@ -14,18 +14,18 @@ "dependencies": { "call-bind": "~1.0.2", "deep-equal": "~1.1.1", - "defined": "~1.0.0", + "defined": "~1.0.1", "dotignore": "~0.1.2", "for-each": "~0.3.3", "glob": "~7.2.3", "has": "~1.0.3", "inherits": "~2.0.4", "is-regex": "~1.1.4", - "minimist": "~1.2.6", - "object-inspect": "~1.12.2", + "minimist": "~1.2.7", + "object-inspect": "~1.12.3", "resolve": "~1.22.1", "resumer": "~0.0.0", - "string.prototype.trim": "~1.2.6", + "string.prototype.trim": "~1.2.7", "through": "~2.3.8" }, "devDependencies": { From 834453cdd4cb95b71d2180a3b28a1ce8e51357b3 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 27 Oct 2022 22:07:57 -0700 Subject: [PATCH 4/6] [actions] update rebase action --- .github/workflows/rebase.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml index 5b6d04b8..18181913 100644 --- a/.github/workflows/rebase.yml +++ b/.github/workflows/rebase.yml @@ -2,14 +2,21 @@ name: Automatic Rebase on: [pull_request_target] +permissions: + contents: read + jobs: _: + permissions: + contents: write # for ljharb/rebase to push code to rebase + pull-requests: read # for ljharb/rebase to get info about PR + name: "Automatic Rebase" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ljharb/rebase@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 0731b5f64311b168ac941ce3e547bb1a32766783 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sun, 15 Jan 2023 13:49:01 -0800 Subject: [PATCH 5/6] [Fix] `throws`: avoid crashing on a nonconfigurable or nonextensible `expected` --- lib/test.js | 10 ++++++---- test/throws.js | 43 ++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/lib/test.js b/lib/test.js index 596f83a5..926da137 100644 --- a/lib/test.js +++ b/lib/test.js @@ -542,10 +542,12 @@ Test.prototype['throws'] = function (fn, expected, msg, extra) { fn(); } catch (err) { caught = { error: err }; - if (Object(err) === err && (!isEnumerable(err, 'message') || !has(err, 'message'))) { - var message = err.message; - delete err.message; - err.message = message; + if (Object(err) === err && 'message' in err && (!isEnumerable(err, 'message') || !has(err, 'message'))) { + try { + var message = err.message; + delete err.message; + err.message = message; + } catch (e) { /**/ } } } diff --git a/test/throws.js b/test/throws.js index 9186d052..a39d3a4a 100644 --- a/test/throws.js +++ b/test/throws.js @@ -176,10 +176,19 @@ tap.test('failures', function (tt) { ' at Test. ($TEST/throws.js:$LINE:$COL)', ' [... stack stripped ...]', ' ...', + '# non-extensible throw match', + 'ok 15 error is non-extensible', + 'ok 16 non-extensible error matches', + 'ok 17 errorWithMessage is non-extensible', + 'ok 18 non-extensible error with message matches', + '# frozen `message` property', + 'ok 19 error is non-writable', + 'ok 20 error is non-configurable', + 'ok 21 non-writable error matches', '', - '1..14', - '# tests 14', - '# pass 4', + '1..21', + '# tests 21', + '# pass 11', '# fail 10', '' ]); @@ -221,4 +230,32 @@ tap.test('failures', function (tt) { t['throws'](function () { throw actual; }, TypeError, 'throws actual'); t.end(); }); + + test('non-extensible throw match', { skip: !Object.seal }, function (t) { + var error = { foo: 1 }; + Object.seal(error); + t.throws(function () { error.x = 1; }, TypeError, 'error is non-extensible'); + + t.throws(function () { throw error; }, error, 'non-extensible error matches'); + + var errorWithMessage = { message: 'abc' }; + Object.seal(errorWithMessage); + t.throws(function () { errorWithMessage.x = 1; }, TypeError, 'errorWithMessage is non-extensible'); + + t.throws(function () { throw errorWithMessage; }, error, 'non-extensible error with message matches'); + + t.end(); + }); + + test('frozen `message` property', { skip: !Object.defineProperty }, function (t) { + var error = { message: 'abc' }; + Object.defineProperty(error, 'message', { configurable: false, enumerable: false, writable: false }); + + t.throws(function () { error.message = 'def'; }, TypeError, 'error is non-writable'); + t.throws(function () { delete error.message; }, TypeError, 'error is non-configurable'); + + t.throws(function () { throw error; }, { message: 'abc' }, 'non-writable error matches'); + + t.end(); + }); }); From a892b65442832c5ddb8185541c78e874dbff5a21 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sun, 15 Jan 2023 15:27:58 -0800 Subject: [PATCH 6/6] v4.16.2 --- CHANGELOG.md | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++- package.json | 2 +- 2 files changed, 69 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac849209..ac483eb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,63 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [v5.6.3](https://github.com/ljharb/tape/compare/v5.6.2...v5.6.3) - 2023-01-15 + +## [v5.6.2](https://github.com/ljharb/tape/compare/v5.6.1...v5.6.2) - 2023-01-15 + +### Fixed + +- [New] `bin/tape`: add `--ignore-pattern` flag [`#586`](https://github.com/ljharb/tape/issues/586) + +### Commits + +- [eslint] fix indentation [`b035590`](https://github.com/ljharb/tape/commit/b035590f782c211e93a6a44ed8d0e9d38636a286) +- [meta] add `auto-changelog` [`b467b85`](https://github.com/ljharb/tape/commit/b467b850f169bf294851c68a5c4074360d53a31b) +- [eslint] enforce `no-use-before-define` [`87deb68`](https://github.com/ljharb/tape/commit/87deb68b111fd0d94efc92c25454a6a3fcedff66) +- [eclint] fix editorconfig [`ce81cbe`](https://github.com/ljharb/tape/commit/ce81cbee9bfc00ebd0abbc70932e3eeab84b159e) +- [eslint] clean up config a bit [`3171edd`](https://github.com/ljharb/tape/commit/3171eddd25dafb3e9a9606ac70ed6c21bb736e8e) +- [Tests] `stackTrace`: use the common `getDiag` utility [`65df5a4`](https://github.com/ljharb/tape/commit/65df5a4f194cf01c3872c713d129ac968342181c) +- [Fix] `throws`: avoid crashing on a nonconfigurable or nonextensible `expected` [`0cd7a2c`](https://github.com/ljharb/tape/commit/0cd7a2cb2e231bd87412170f05020fd910e6d3e4) +- [meta] fix repo URLs [`85d86a4`](https://github.com/ljharb/tape/commit/85d86a468af1b74af432d41c204efd4440b5f56f) +- Revert "[Tests] handle a broken error `cause` in node 16.9/16.10" [`775ba37`](https://github.com/ljharb/tape/commit/775ba3789e16b1464dc810243dc5866b2868fc1d) +- [meta] use `npmignore` to autogenerate an npmignore file [`1645abb`](https://github.com/ljharb/tape/commit/1645abbf47df2a8142514302da2730c54b993b47) +- [eslint] enable `func-style` [`75c0c3a`](https://github.com/ljharb/tape/commit/75c0c3a4f9452c36b5318ba6c09ab4ebc97f15d0) +- [actions] update rebase action [`b3d724e`](https://github.com/ljharb/tape/commit/b3d724e9ddfcca3c3d78f3c9d53158b5aef2208b) +- [Deps] update `array.prototype.every`, `deep-equal`, `string.prototype.trim` [`e9c9aba`](https://github.com/ljharb/tape/commit/e9c9abab037b274bb9b239b26c33d94eb8b7e802) +- [Deps] update `defined`, `minimist`, `resolve` [`83695c0`](https://github.com/ljharb/tape/commit/83695c03495801e6cf98cba7328d287e47f3afde) +- [Deps] update `deep-equal`, `object-inspect` [`09906f3`](https://github.com/ljharb/tape/commit/09906f323c69b5f189675bf0faad9d5be4831706) +- [Dev Deps] update `@ljharb/eslint-config`, `aud` [`afd8f64`](https://github.com/ljharb/tape/commit/afd8f64712daade8ccd29b727d90bccab9f5ce12) +- [Dev Deps] update `array.prototype.flatmap` [`8b8bf07`](https://github.com/ljharb/tape/commit/8b8bf07312adb248238238a0d810b0eedeb8b2b5) +- [Dev Deps] update `aud` [`f0fe7c0`](https://github.com/ljharb/tape/commit/f0fe7c0979ba5d7ea96c619fab5389979cd0a862) +- [Dev Deps] update `tap-parser` [`2f61eac`](https://github.com/ljharb/tape/commit/2f61eac3800d63fba65895bbfa947b8b82346cf0) +- Merge tag 'v4.16.1' [`96ff863`](https://github.com/ljharb/tape/commit/96ff863913b282e13bc5200179fcb1a757933449) +- [readme] fix version badge [`20ea48d`](https://github.com/ljharb/tape/commit/20ea48d53b6492bf648d02d53c41b324abbfb6e1) + +## [v5.6.1](https://github.com/ljharb/tape/compare/v5.6.0...v5.6.1) - 2022-09-19 + +### Commits + +- [eslint] fix indentation [`2151e06`](https://github.com/ljharb/tape/commit/2151e06877e65802ef7364bc6bebc21fc45e3699) +- [meta] add `auto-changelog` [`86cbbd1`](https://github.com/ljharb/tape/commit/86cbbd1bb6bdc57fc718c6043866ab6bed46899c) +- [eslint] enforce `no-use-before-define` [`f8a8a7f`](https://github.com/ljharb/tape/commit/f8a8a7f35402ebf9865cafd3682e9a6b0188436e) +- [meta] fix repo URLs [`a9ae3c2`](https://github.com/ljharb/tape/commit/a9ae3c22db37d760fc30aea5053302177e7c3d3e) +- [Tests] `stackTrace`: use the common `getDiag` utility [`298cb80`](https://github.com/ljharb/tape/commit/298cb806ef4a438792cb533675b6faa4b02a1d92) +- [eslint] enable `func-style` [`98b9623`](https://github.com/ljharb/tape/commit/98b9623fc16f5ebe1be8beba4c21d9494bce05ac) +- [New] `bin/tape`: include the exact arg when there are no glob results; use require on `--require` files [`6a1ce43`](https://github.com/ljharb/tape/commit/6a1ce4389e8b601249c3c81b31cd60eea3e0f74a) +- [eslint] clean up config a bit [`67ad201`](https://github.com/ljharb/tape/commit/67ad20117457313ab2c9d63365573858efb51566) +- [meta] create FUNDING.yml [`5b4752f`](https://github.com/ljharb/tape/commit/5b4752fe006597002918cbd3ee8a4e50f48677ca) +- [Refactor] `bin/tape`: make it a bit more functional, for easier v5 backporting [`fbdbfc9`](https://github.com/ljharb/tape/commit/fbdbfc90dd7afeba89cc3dd5e6280ed247f8b789) +- [Deps] update `glob`, `object-inspect`, `resolve`, `string.prototype.trim` [`6a3c200`](https://github.com/ljharb/tape/commit/6a3c2009e7f6052bd4423dce80bb140e234a877f) +- [Dev Deps] update `@ljharb/eslint-config`, `array.prototype.flatmap`, `es-value-fixtures`, `falafel` [`934d49b`](https://github.com/ljharb/tape/commit/934d49b1e840d3c57bd6e52a74017e06c6a55934) +- [Tests] fix no_only tests on Windows [`f35f71b`](https://github.com/ljharb/tape/commit/f35f71bd44e76eb53bedd63615e59fdc382e4d0d) +- Revert "[Tests] handle a broken error `cause` in node 16.9/16.10" [`23fac16`](https://github.com/ljharb/tape/commit/23fac16760344fe6843722b626dcba9e2e1c8372) +- [Robustness] `test` observably looks up `exec` on the object [`4575ca4`](https://github.com/ljharb/tape/commit/4575ca4b185cb503c93e29113b99e10f1ae4b63c) +- [meta] add SECURITY.md [`7b0c901`](https://github.com/ljharb/tape/commit/7b0c901b459b19668fcf6cc5b4b08f42978135b4) +- [meta] add missing npmrc config [`5d11d84`](https://github.com/ljharb/tape/commit/5d11d844c87d64b6bac6fbe70357ad587ba0281a) +- [Deps] update `object.assign` [`3327fdd`](https://github.com/ljharb/tape/commit/3327fdd249e3a0abf21311d2ca229d6f59fa2b26) +- [readme] fix version badge [`74e6c9e`](https://github.com/ljharb/tape/commit/74e6c9e02daa286c86f7d5f4d4e019e62b8322a2) +- Merge tag 'v4.16.0' [`4a44a7e`](https://github.com/ljharb/tape/commit/4a44a7ee31dd24dff833909366449a3da6116a78) + ## [v5.6.0](https://github.com/ljharb/tape/compare/v5.5.3...v5.6.0) - 2022-08-16 ### Commits @@ -412,7 +469,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [Deps] update `resolve` [`b765bba`](https://github.com/ljharb/tape/commit/b765bba1ea56075d5382b203b6902c8fc5f2d5a6) - [Dev Deps] update `eslint` [`949781f`](https://github.com/ljharb/tape/commit/949781faf753d5481085f993210738e7b93b3172) -## [v5.0.0-next.0](https://github.com/ljharb/tape/compare/v4.16.1...v5.0.0-next.0) - 2019-12-20 +## [v5.0.0-next.0](https://github.com/ljharb/tape/compare/v4.16.2...v5.0.0-next.0) - 2019-12-20 ### Commits @@ -425,6 +482,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [meta] change dep semver prefix from ~ to ^ [`c3924d3`](https://github.com/ljharb/tape/commit/c3924d34476247e2ba0d6e0781ca89b7d25f2a2b) - [Breaking] update `deep-equal` to v2 [`898a6e7`](https://github.com/ljharb/tape/commit/898a6e70aadff95f23eb6f7b4e7a1fd24baacc7d) +## [v4.16.2](https://github.com/ljharb/tape/compare/v4.16.1...v4.16.2) - 2023-01-15 + +### Commits + +- [Fix] `throws`: avoid crashing on a nonconfigurable or nonextensible `expected` [`0731b5f`](https://github.com/ljharb/tape/commit/0731b5f64311b168ac941ce3e547bb1a32766783) +- [actions] update rebase action [`834453c`](https://github.com/ljharb/tape/commit/834453cdd4cb95b71d2180a3b28a1ce8e51357b3) +- [Deps] update `defined`, `minimist`, `object-inspect`, `string.prototype.trim` [`01edce8`](https://github.com/ljharb/tape/commit/01edce8073efe1134c5fff58638b350afb7c6d22) +- [Dev Deps] update `@ljharb/eslint-config`, `array.prototype.flatmap`, `aud` [`1b3ad24`](https://github.com/ljharb/tape/commit/1b3ad2429b553f7e029fe9fd5977b07e76740e42) +- [meta] add missing npmrc config [`15e2175`](https://github.com/ljharb/tape/commit/15e2175b927010657c66f0a30e44f5266147311f) + ## [v4.16.1](https://github.com/ljharb/tape/compare/v4.16.0...v4.16.1) - 2022-09-19 ### Commits diff --git a/package.json b/package.json index e049db46..a83d8340 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tape", - "version": "4.16.1", + "version": "4.16.2", "description": "tap-producing test harness for node and browsers", "main": "index.js", "browser": {