89 lines
3.2 KiB
RPMSpec
89 lines
3.2 KiB
RPMSpec
%{?nodejs_find_provides_and_requires}
|
|
%global enable_tests 1
|
|
Name: mocha
|
|
Version: 2.4.5
|
|
Release: 2
|
|
Summary: A simple, flexible, fun test framework for Node.js
|
|
License: MIT
|
|
URL: https://github.com/mochajs/mocha
|
|
Source0: https://github.com/mochajs/mocha/archive/v%{version}/mocha-%{version}.tar.gz
|
|
Patch0: mocha-node-dep.patch
|
|
Patch1: mocha-tests.patch
|
|
BuildArch: noarch
|
|
ExclusiveArch: %{nodejs_arches} noarch
|
|
BuildRequires: nodejs-packaging
|
|
%if 0%{?enable_tests}
|
|
BuildRequires: npm(chalk) npm(commander) npm(debug) npm(diff) npm(escape-string-regexp)
|
|
BuildRequires: npm(glob) npm(growl) npm(jade) npm(mkdirp) npm(should) npm(supports-color)
|
|
%endif
|
|
%description
|
|
Mocha is a feature-rich JavaScript test framework running on Node.js and the
|
|
browser, making asynchronous testing simple and fun. Mocha tests run serially,
|
|
allowing for flexible and accurate reporting, while mapping uncaught
|
|
exceptions to the correct test cases.
|
|
|
|
%prep
|
|
%autosetup -p 1
|
|
%nodejs_fixdep commander "^2.2.0"
|
|
%nodejs_fixdep debug "^4.3.4"
|
|
%nodejs_fixdep diff "^1.0.8"
|
|
%nodejs_fixdep escape-string-regexp "^1.0.2"
|
|
%nodejs_fixdep glob "^6.0.3"
|
|
%nodejs_fixdep growl "^1.7.0"
|
|
%nodejs_fixdep jade "^1.3.1"
|
|
%nodejs_fixdep mkdirp "^0.5.0"
|
|
%nodejs_fixdep supports-color
|
|
|
|
%build
|
|
|
|
%install
|
|
mkdir -p %{buildroot}%{nodejs_sitelib}/mocha
|
|
cp -pr package.json index.js lib/ mocha.css mocha.js \
|
|
%{buildroot}%{nodejs_sitelib}/mocha
|
|
rm -f %{buildroot}%{nodejs_sitelib}/mocha/lib/template.html
|
|
rm -rf %{buildroot}%{nodejs_sitelib}/mocha/lib/reporters/templates
|
|
mkdir -p %{buildroot}%{nodejs_sitelib}/mocha/bin
|
|
install -p -D -m0755 bin/mocha %{buildroot}%{nodejs_sitelib}/mocha/bin/mocha
|
|
install -p -D -m0755 bin/_mocha %{buildroot}%{nodejs_sitelib}/mocha/bin/_mocha
|
|
install -p -D -m0644 bin/options.js %{buildroot}%{nodejs_sitelib}/mocha/bin/options.js
|
|
mkdir -p %{buildroot}%{_bindir}
|
|
ln -sf %{nodejs_sitelib}/mocha/bin/mocha %{buildroot}%{_bindir}/mocha
|
|
ln -sf %{nodejs_sitelib}/diff/diff.js \
|
|
%{buildroot}%{nodejs_sitelib}/mocha/lib/browser/diff.js
|
|
mkdir -p %{buildroot}%{_datadir}/mocha/images
|
|
cp -pr images/*.png \
|
|
%{buildroot}%{_datadir}/mocha/images
|
|
ln -sf %{_datadir}/mocha/images \
|
|
%{buildroot}%{nodejs_sitelib}/mocha/images
|
|
cp -pr lib/template.html \
|
|
%{buildroot}%{_datadir}/mocha
|
|
ln -sf %{_datadir}/mocha/template.html \
|
|
%{buildroot}%{nodejs_sitelib}/mocha/lib/template.html
|
|
cp -pr lib/reporters/templates \
|
|
%{buildroot}%{_datadir}/mocha
|
|
ln -sf %{_datadir}/mocha/templates \
|
|
%{buildroot}%{nodejs_sitelib}/mocha/lib/reporters/templates
|
|
%nodejs_symlink_deps
|
|
%if 0%{?enable_tests}
|
|
|
|
%check
|
|
%nodejs_symlink_deps --check
|
|
sed -i -e 's/1000/30000/' test/color.js
|
|
sed -i -e 's/200/30000/' test/acceptance/context.js
|
|
./bin/mocha --timeout 30000 test/acceptance/*.js test/*.js
|
|
%endif
|
|
|
|
%files
|
|
%doc README.md CHANGELOG.md CONTRIBUTING.md
|
|
%license LICENSE
|
|
%{nodejs_sitelib}/mocha
|
|
%{_bindir}/mocha
|
|
%{_datadir}/mocha
|
|
|
|
%changelog
|
|
* Sat Jul 02 2022 chenchen <chen_aka_jan@163.com> - 2.4.5-2
|
|
- Updating debug version
|
|
|
|
* Wed Aug 19 2020 shaoqiang kang <kangshaoqiang1@huawei.com> - 2.4.5-1
|
|
- Package init
|