The package rpms/nodejs-p-finally.git has added or updated architecture specific content
in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/nodejs-p-finally.git/commit/?id=9....
Change:
+ExclusiveArch: %{nodejs_arches} noarch
Thanks.
Full change:
============
commit 9719d23624802dbb87c95b963abbea5e18bb6b7d
Author: Jared K. Smith <jaredsmith(a)jaredsmith.net>
Date: Tue Jun 6 15:19:15 2017 -0400
Initial packaging
diff --git a/.gitignore b/.gitignore
index e69de29..66c0495 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/p-finally-1.0.0.tgz
diff --git a/nodejs-p-finally.spec b/nodejs-p-finally.spec
new file mode 100644
index 0000000..fa3b193
--- /dev/null
+++ b/nodejs-p-finally.spec
@@ -0,0 +1,63 @@
+%{?nodejs_find_provides_and_requires}
+
+%global packagename p-finally
+
+# tests missing due to missing npm(ava)
+%global enable_tests 0
+
+Name: nodejs-p-finally
+Version: 1.0.0
+Release: 1%{?dist}
+Summary: Promise#finally() ponyfill - Invoked when the promise is settled
+
+License: MIT
+URL:
https://github.com/sindresorhus/p-finally
+Source0:
https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
+# The test files are not included in the npm tarball.
+Source1:
https://raw.githubusercontent.com/sindresorhus/p-finally/v1.0.0/test.js
+
+ExclusiveArch: %{nodejs_arches} noarch
+BuildArch: noarch
+
+BuildRequires: nodejs-packaging
+%if 0%{?enable_tests}
+BuildRequires: npm(ava)
+%endif
+
+%description
+Promise#finally() ponyfill - Invoked when the promise is settled regardless of
+outcome.
+
+
+%prep
+%autosetup -n package
+# setup the tests
+cp -p %{SOURCE1} .
+
+%build
+# nothing to do!
+
+%install
+mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
+cp -pr package.json index.js \
+ %{buildroot}%{nodejs_sitelib}/%{packagename}
+
+%nodejs_symlink_deps
+
+%check
+%nodejs_symlink_deps --check
+%{__nodejs} -e 'require("./")'
+%if 0%{?enable_tests}
+%{_bindir}/ava
+%else
+%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
+%endif
+
+%files
+%doc readme.md
+%license license
+%{nodejs_sitelib}/%{packagename}
+
+%changelog
+* Wed Apr 19 2017 Jared Smith <jsmith(a)fedoraproject.org> - 1.0.0-1
+- Initial packaging
diff --git a/sources b/sources
index e69de29..cac6457 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (p-finally-1.0.0.tgz) =
2c809bda9f4207b152fb4791d68a969c7869d0596318b64258113d6a2c745327bd5bc2d340fc0c4d8546590588c3d45d4220e0e3e7a95d0383c08609b5225aa3
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..613b0a4
--- /dev/null
+++ b/test.js
@@ -0,0 +1,46 @@
+import test from 'ava';
+import m from './';
+
+const fixture = Symbol('fixture');
+const fixtureErr = new Error('err');
+
+test('does nothing when nothing is passed', async t => {
+ t.is(await m(Promise.resolve(fixture)), fixture);
+});
+
+test('callback is called when promise is fulfilled', async t => {
+ let called = false;
+
+ const val = await m(Promise.resolve(fixture), () => {
+ called = true;
+ });
+
+ t.is(val, fixture);
+ t.true(called);
+});
+
+test('callback is called when promise is rejected', async t => {
+ let called = false;
+
+ await m(Promise.reject(fixtureErr), () => {
+ called = true;
+ }).catch(err => {
+ t.is(err, fixtureErr);
+ });
+
+ t.true(called);
+});
+
+test('returning a rejected promise in the callback rejects the promise', async t
=> {
+ await m(Promise.resolve(fixture), () => Promise.reject(fixtureErr)).then(() => {
+ t.fail();
+ }, err => {
+ t.is(err, fixtureErr);
+ });
+});
+
+test('returning a rejected promise in the callback for an already rejected promise
changes the rejection reason', async t => {
+ await m(Promise.reject(new Error('orig err')), () =>
Promise.reject(fixtureErr)).catch(err => {
+ t.is(err, fixtureErr);
+ });
+});