Date: Sunday, November 27, 2022 @ 16:03:02 Author: yan12125 Revision: 1354113
upgpkg: web-ext 7.4.0-1; make tests pass on Node.js 19 & make tests more robust See: https://github.com/mozilla/web-ext/issues/2564 Added: web-ext/trunk/nodejs19.diff Modified: web-ext/trunk/PKGBUILD ---------------+ PKGBUILD | 16 ++++++++++++---- nodejs19.diff | 26 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 4 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2022-11-27 13:01:57 UTC (rev 1354112) +++ PKGBUILD 2022-11-27 16:03:02 UTC (rev 1354113) @@ -2,7 +2,7 @@ pkgname=web-ext # https://github.com/mozilla/web-ext/releases -pkgver=7.3.1 +pkgver=7.4.0 pkgrel=1 pkgdesc='A command line tool to help build, run, and test web extensions' arch=(any) @@ -17,12 +17,19 @@ # to speed up the build options=('!strip') # tarball on npmjs lacks scripts for building from sources -source=("https://github.com/mozilla/web-ext/archive/$pkgver/web-ext-$pkgver.tar.gz") -sha256sums=('d916163a4c4a9a2b7c7b42924eaf2b221d902825171d0b0af441d64de9796f24') +source=("https://github.com/mozilla/web-ext/archive/$pkgver/web-ext-$pkgver.tar.gz" + "nodejs19.diff") +sha256sums=('915e9b2175094634c666a3ee85e454e60a57e438e647f898ef47c87db8d8fccc' + '9475a50851a8442dd8edad55f5b678923808396eedfae45dd29a960cc0646529') prepare() { cd "$srcdir" + # Make tests pass with Node.js 19 https://github.com/mozilla/web-ext/issues/2564 + pushd $pkgname-$pkgver + patch -Np1 -i ../nodejs19.diff + popd + # -build for running webpack and tests, and the original for actual packaging cp -r $pkgname-$pkgver{,-build} } @@ -42,7 +49,8 @@ cd "$srcdir/$pkgname-$pkgver-build" # web-ext uses flow-bin, which does not support some architectures (e.g., RISC-V) - CI_SKIP_FLOWCHECK=y npm test + # Some tests match error messages and fail if messages are translated + LANG=C.UTF-8 CI_SKIP_FLOWCHECK=y npm test } package() { Added: nodejs19.diff =================================================================== --- nodejs19.diff (rev 0) +++ nodejs19.diff 2022-11-27 16:03:02 UTC (rev 1354113) @@ -0,0 +1,26 @@ +diff --git a/tests/unit/test-cmd/test.build.js b/tests/unit/test-cmd/test.build.js +index 9a63278..97e1295 100644 +--- a/tests/unit/test-cmd/test.build.js ++++ b/tests/unit/test-cmd/test.build.js +@@ -269,7 +269,7 @@ describe('build', () => { + assert.instanceOf(error, UsageError); + assert.match( + error.message, +- /Unexpected string in JSON at position 14/ ++ /Expected ':' after property name in JSON at position 14/ + ); + assert.match(error.message, /^Error parsing messages\.json/); + assert.include(error.message, messageFileName); +diff --git a/tests/unit/test-util/test.manifest.js b/tests/unit/test-util/test.manifest.js +index 7e9e17a..5fc665e 100644 +--- a/tests/unit/test-util/test.manifest.js ++++ b/tests/unit/test-util/test.manifest.js +@@ -70,7 +70,7 @@ describe('util/manifest', () => { + ); + assert.include( + error.message, +- 'Unexpected token "," (0x2C) in JSON at position 51' ++ 'Expected double-quoted property name in JSON at position 51' + ); + assert.include(error.message, manifestFile); + })
