Blob Blame History Raw
%{?nodejs_find_provides_and_requires}

%global packagename assume
%global enable_tests 1

Name:		nodejs-assume
Version:	1.5.1
Release:	1%{?dist}
Summary:	Expect-like assertions that works seamlessly in node and browsers

License:	MIT
URL:		https://github.com/bigpipe/assume
Source0:	https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
# The test files are not included in the npm tarball.
# Source1 is generated by running Source10, which pulls from the upstream
# version control repository.
Source1:	tests-%{version}.tar.bz2
Source10:	dl-tests.sh

# Remove one failing test
Patch0:		nodejs-assume_remove-failing-test.patch

ExclusiveArch:	%{nodejs_arches} noarch
BuildArch:	noarch

BuildRequires:	nodejs-packaging
%if 0%{?enable_tests}
BuildRequires:	mocha
BuildRequires:	npm(deep-eql)
BuildRequires:	npm(fn.name)
BuildRequires:	npm(object-inspect)
BuildRequires:	npm(pathval)
BuildRequires:	npm(pruddy-error)
%endif

%description
Expect-like assertions that works seamlessly in node and browsers


%prep
%setup -q -n package
# setup the tests
%setup -q -T -D -a 1 -n package
# remove failing test
%patch0 -p1

%nodejs_fixdep object-inspect
%nodejs_fixdep pathval

%build
# nothing to do!

%install
mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
cp -pr package.json *.js dist/ \
	%{buildroot}%{nodejs_sitelib}/%{packagename}

%nodejs_symlink_deps

%check
%nodejs_symlink_deps --check
%{__nodejs} -e 'require("./")'
%if 0%{?enable_tests}
%{_bindir}/mocha -R spec
%else
%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
%endif

%files
%doc *.md
%license LICENSE
%{nodejs_sitelib}/%{packagename}

%changelog
* Thu May 04 2017 Jared Smith <jsmith@fedoraproject.org> - 1.5.1-1
- Update to upstream 1.5.1 release

* Thu Mar 30 2017 Jared Smith <jsmith@fedoraproject.org> - 1.4.1-2
- Fix dependency version for npm(pathval)

* Wed Mar 29 2017 Jared Smith <jsmith@fedoraproject.org> - 1.4.1-1
- Initial packaging