%global enable_tests 0 %global srcname ava %global commit0 cf4718a0ca62f8027867e8850b6e096af884a7d8 %global gittag0 v0.2.0 %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) Name: nodejs-%{srcname} Version: 0.2.0 Release: 1%{?dist} Summary: Simple concurrent test runner License: MIT URL: https://www.npmjs.com/package/ava Source0: https://github.com/sindresorhus/%{srcname}/archive/%{commit0}.tar.gz#/%{srcname}-%{shortcommit0}.tar.gz BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch BuildRequires: nodejs-packaging %if 0%{?enable_tests} BuildRequires: npm(fn-name) %endif %description Even though JavaScript is single-threaded, IO in Node.js can happen in parallel due to its async nature. AVA takes advantage of this and runs your tests concurrently, which is especially beneficial for IO heavy tests. Switching from Mocha to AVA in Pageres brought the test time down from 31 sec to 11 sec. Having tests run concurrently forces you to write atomic tests, meaning tests that don't depend on global state or the state of other tests, which is a great thing! %prep %setup -qn %{srcname}-%{commit0} rm -rf node_modules/ %build #nothing to do %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{srcname} cp -pr index.js package.json cli.js lib/ \ %{buildroot}%{nodejs_sitelib}/%{srcname} mkdir -p %{buildroot}%{_bindir} ln -s %{nodejs_sitelib}/%{srcname}/cli.js %{buildroot}%{_bindir}/ava %nodejs_symlink_deps %if 0%{?enable_tests} %check %nodejs_symlink_deps --check node test/test.js %endif %files %doc readme.md %license license %{nodejs_sitelib}/%{srcname} %{_bindir}/ava %changelog * Sat Oct 17 2015 Piotr Popieluch - 0.2.0-1 - Update to 0.2.0 * Tue Sep 01 2015 Piotr Popieluch - 0.1.0-1 - Update to 0.1.0 * Wed Dec 31 2014 Piotr Popieluch - 0.0.4-1 - Initial package