diff --git a/0001-Fix-tests-for-Node.js-6.5.patch b/0001-Fix-tests-for-Node.js-6.5.patch new file mode 100644 index 0000000..51d437f --- /dev/null +++ b/0001-Fix-tests-for-Node.js-6.5.patch @@ -0,0 +1,28 @@ +From 004b6f092c96696dde28027553dc3d6c6e1e894e Mon Sep 17 00:00:00 2001 +Date: Tue, 6 Dec 2016 12:30:04 -0500 +Subject: [PATCH] Fix tests for Node.js 6.5+ + +--- + tests/test.js | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test.js b/tests/test.js +index ab2708a34eddef5b7f2091a0f3d6c91974c15b7c..239589ef5a2ceef2224a9bcab951350bac3e70ba 100644 +--- a/tests/test.js ++++ b/tests/test.js +@@ -69,11 +69,11 @@ function fff() { + } + + it('should format function', function() { + var f = function() { + }; +- assert.equal(format(f), 'Function { name: \'\' }'); ++ assert.equal(format(f), 'Function { name: \'f\' }'); + + assert.equal(format(fff), 'Function { name: \'fff\' }'); + + //TODO add test for arrow function + }); +-- +2.9.3 + diff --git a/nodejs-should-format.spec b/nodejs-should-format.spec new file mode 100644 index 0000000..01637da --- /dev/null +++ b/nodejs-should-format.spec @@ -0,0 +1,40 @@ +Name: nodejs-should-format +Version: 0.3.2 +Release: 1 +Summary: Formatting of objects for should.js +License: MIT +URL: https://github.com/shouldjs/format +Source0: https://registry.npmjs.org/should-format/-/should-format-%{version}.tgz +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch +BuildRequires: nodejs-packaging +BuildRequires: npm(mocha) npm(should-type) +Patch0001: 0001-Fix-tests-for-Node.js-6.5.patch +%description +%{summary}. + +%prep +%setup -q -n package +%patch0001 -p1 +sed -i 's/\r$//' README.md +rm -rf node_modules + +%build + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/should-format +cp -pr package.json index.js util.js %{buildroot}%{nodejs_sitelib}/should-format +%nodejs_symlink_deps + +%check +%nodejs_symlink_deps --check +%{nodejs_sitelib}/mocha/bin/mocha --ui bdd tests/test.js + +%files +%doc README.md +%license LICENSE +%{nodejs_sitelib}/should-format + +%changelog +* Wed Aug 12 2020 wangyue - 0.3.2-1 +- package init diff --git a/nodejs-should-format.yaml b/nodejs-should-format.yaml new file mode 100644 index 0000000..bf2ef92 --- /dev/null +++ b/nodejs-should-format.yaml @@ -0,0 +1,5 @@ +git_url: https://github.com/shouldjs/format +version_control: github +src_repo: shouldjs/format +tag_prefix: "^" +seperator: "." diff --git a/should-format-0.3.2.tgz b/should-format-0.3.2.tgz new file mode 100644 index 0000000..88e3c6a Binary files /dev/null and b/should-format-0.3.2.tgz differ