Fix build error

This commit is contained in:
lei_ju 2020-09-16 14:21:29 +08:00
parent fd18e2035a
commit a100dbc41a
4 changed files with 30 additions and 5 deletions

View File

@ -0,0 +1,22 @@
From abe1ef2f3fdfaf8c12a28af4abdcfc9057b8410c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= <kapouer@melix.org>
Date: Thu, 4 Jan 2018 00:56:06 +0100
Subject: [PATCH] Fix AssertionError detection for node > 6
---
test.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test.js b/test.js
index 3a17e3c..f751076 100644
--- a/test.js
+++ b/test.js
@@ -41,7 +41,7 @@ function Test(name, unit, logger, Assert) {
if (isSync) assert.end()
}
} catch (exception) {
- if (ERR_EXPECT === exception.name) assert.fail(exception)
+ if (exception.name && exception.name.startsWith(ERR_EXPECT)) assert.fail(exception)
else logger.error(exception)
assert.end()
}

View File

@ -1,30 +1,30 @@
# needed for building on el6
%{?nodejs_find_provides_and_requires}
%global enable_tests 1
%global srcname test
%global owner gozala
Name: nodejs-%{srcname}
Version: 0.6.0
Release: 1
Release: 2
Summary: (Un)CommonJS test runner
License: MIT
URL: https://github.com/Gozala/test-commonjs
Source0: https://registry.npmjs.org/test/-/test-%{version}.tgz
Source0: https://github.com/Gozala/test-commonjs/archive/v%{version}.tar.gz
Patch0000: Fix-AssertionError-detection-for-node.patch
BuildArch: noarch
ExclusiveArch: %{nodejs_arches} noarch
BuildRequires: nodejs-packaging
%if 0%{?enable_tests}
BuildRequires: nodejs-ansi-font
%endif
%description
%{summary}.
%prep
%setup -qn package
%autosetup -n test-commonjs-%{version} -p1 -S git
rm -rf node_modules
%build
#nothing to do
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/%{srcname}
@ -45,5 +45,8 @@ cp -pr package.json *.js \
%{nodejs_sitelib}/%{srcname}
%changelog
* Wed Sep 16 2020 leiju <leiju4@huawei.com> - 0.6.0-2
- Fix AssertionError detection for node
* Tue Aug 11 2020 wutao <wutao61@huawei.com> - 0.6.0-1
- package init

Binary file not shown.

BIN
v0.6.0.tar.gz Normal file

Binary file not shown.