Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Commit

Permalink
upgpkg: web-ext 7.4.0-1; make tests pass on Node.js 19 & make tests m…
Browse files Browse the repository at this point in the history
…ore robust

See: mozilla/web-ext#2564


git-svn-id: file:///srv/repos/svn-community/svn@1354113 9fca08f4-af9d-4005-b8df-a31f2cc04f65
  • Loading branch information
yan12125 committed Nov 27, 2022
1 parent 6424cb8 commit 7fd6769
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
16 changes: 12 additions & 4 deletions web-ext/trunk/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -17,12 +17,19 @@ conflicts=('nodejs-web-ext')
# 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}
}
Expand All @@ -42,7 +49,8 @@ check() {
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() {
Expand Down
26 changes: 26 additions & 0 deletions web-ext/trunk/nodejs19.diff
Original file line number Diff line number Diff line change
@@ -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);
})

0 comments on commit 7fd6769

Please sign in to comment.