fuanan add package

This commit is contained in:
fwx913451 2020-08-20 21:23:10 +08:00
parent 8d895e6bdb
commit 9ef8468a08
6 changed files with 209 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,32 @@
commit 95c374348a50bd1b1a07a4f82f7f630d240bf843
Author: Tom Hughes <tom@compton.nu>
Date: Sun Nov 22 00:43:09 2015 +0000
Fix test for changes in junit reporter
I'm not clear why, but the junit reporter seems to report one
error and one failure now instead of two errors.
diff --git a/test/nodeunit_test.js b/test/nodeunit_test.js
index a5f8cbf..6ef069e 100644
--- a/test/nodeunit_test.js
+++ b/test/nodeunit_test.js
@@ -62,7 +62,7 @@ exports.nodeunit = {
});
},
junit: function(test) {
- test.expect(4);
+ test.expect(5);
grunt.util.spawn({
grunt: true,
args: ['test-junit:fail', '--no-color'],
@@ -73,7 +73,8 @@ exports.nodeunit = {
var junitContents = grunt.util.normalizelf(grunt.file.read(junitFile));
test.ok(junitContents.indexOf('<testsuite name="fail.js"') !== -1, 'testsuite element');
- test.ok(junitContents.indexOf('errors="2"') !== -1, 'Two errors detected');
+ test.ok(junitContents.indexOf('errors="1"') !== -1, 'One errore detected');
+ test.ok(junitContents.indexOf('failures="1"') !== -1, 'One failure detected');
test.ok(junitContents.indexOf('AssertionError: this value should be truthy') !== -1, 'Assertion');
test.ok(junitContents.indexOf('fail - failSupertestError') !== -1, 'Failure message');

View File

@ -0,0 +1,54 @@
%{?nodejs_find_provides_and_requires}
%global enable_tests 1
Name: nodejs-grunt-contrib-nodeunit
Version: 0.4.1
Release: 1
Summary: Run Nodeunit unit tests with grunt
License: MIT
URL: https://github.com/gruntjs/grunt-contrib-nodeunit
Source0: https://github.com/gruntjs/grunt-contrib-nodeunit/archive/v%{version}/grunt-contrib-nodeunit-%{version}.tar.gz
Patch0: nodejs-grunt-contrib-nodeunit-junit.patch
Patch1: nodejs-grunt-contrib-nodeunit_fix-operator-test.patch
BuildArch: noarch
%if 0%{?fedora} >= 19
ExclusiveArch: %{nodejs_arches} noarch
%else
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
%endif
BuildRequires: nodejs-packaging
%if 0%{?enable_tests}
BuildRequires: npm(grunt-cli) npm(grunt-contrib-clean) npm(grunt-contrib-internal)
BuildRequires: npm(nodeunit) npm(tap)
%endif
%description
%{summary}.
%prep
%setup -q -n grunt-contrib-nodeunit-%{version}
%patch0 -p1
%patch1 -p1
%build
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/grunt-contrib-nodeunit
cp -pr package.json tasks/ \
%{buildroot}%{nodejs_sitelib}/grunt-contrib-nodeunit
%nodejs_symlink_deps
%check
%nodejs_symlink_deps --check
%if 0%{?enable_tests}
%{_bindir}/grunt nodeunit
%else
%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
%endif
%files
%doc README.md docs/
%license LICENSE-MIT
%{nodejs_sitelib}/grunt-contrib-nodeunit
%changelog
* Thu Aug 20 2020 Anan Fu <fuanan3@huawei.com> - 0.4.1-1
- package init

View File

@ -0,0 +1,100 @@
%{?nodejs_find_provides_and_requires}
%global enable_tests 1
Name: nodejs-grunt-contrib-nodeunit
Version: 0.4.1
Release: 4%{?dist}
Summary: Run Nodeunit unit tests with grunt
License: MIT
Group: System Environment/Libraries
URL: https://github.com/gruntjs/grunt-contrib-nodeunit
Source0: https://github.com/gruntjs/grunt-contrib-nodeunit/archive/v%{version}/grunt-contrib-nodeunit-%{version}.tar.gz
Patch0: nodejs-grunt-contrib-nodeunit-junit.patch
Patch1: nodejs-grunt-contrib-nodeunit_fix-operator-test.patch
BuildArch: noarch
%if 0%{?fedora} >= 19
ExclusiveArch: %{nodejs_arches} noarch
%else
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
%endif
BuildRequires: nodejs-packaging
%if 0%{?enable_tests}
BuildRequires: npm(grunt-cli)
BuildRequires: npm(grunt-contrib-clean)
BuildRequires: npm(grunt-contrib-internal)
BuildRequires: npm(nodeunit)
BuildRequires: npm(tap)
%endif
%description
%{summary}.
%prep
%setup -q -n grunt-contrib-nodeunit-%{version}
%patch0 -p1
%patch1 -p1
#find docs/ -size 0 -delete
%build
#nothing to do
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/grunt-contrib-nodeunit
cp -pr package.json tasks/ \
%{buildroot}%{nodejs_sitelib}/grunt-contrib-nodeunit
%nodejs_symlink_deps
%check
%nodejs_symlink_deps --check
%if 0%{?enable_tests}
%{_bindir}/grunt nodeunit
%else
%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
%endif
%files
%doc README.md docs/
%license LICENSE-MIT
%{nodejs_sitelib}/grunt-contrib-nodeunit
%changelog
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Feb 22 2016 Jared Smith <jsmith@fedoraproject.org> - 0.4.1-3
- Fix FTBFS for failing test
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Sun Nov 22 2015 Tom Hughes <tom@compton.nu> - 0.4.1-1
- update to 0.4.1 upstream release
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Sat Apr 19 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.3.3-2
- update to upstream release 0.3.3
* Mon Feb 24 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.3.2-1
- update to upstream release 0.3.2
- take Source0 from GitHub as the NPM tarball is missing several useful files
- add missing BuildRequires
* Fri Jun 21 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.2.0-1
- initial package

View File

@ -0,0 +1,4 @@
version_control: github
src_repo: gruntjs/grunt-contrib-nodeunit
tag_prefix: "^"
seperator: "."

View File

@ -0,0 +1,19 @@
diff --git a/test/nodeunit_test.js b/test/nodeunit_test.js
index a5f8cbf..9b4f4c0 100644
--- a/test/nodeunit_test.js
+++ b/test/nodeunit_test.js
@@ -10,12 +10,12 @@ exports.nodeunit = {
test.done();
},
fail: function(test) {
- test.expect(3);
+ test.expect(2);
grunt.util.spawn({
grunt: true,
args: ['test:fail', '--no-color'],
}, function(err, result) {
- test.ok(result.stdout.indexOf("Operator:") !== -1, 'Operator should display for multiline.');
+// test.ok(result.stdout.indexOf("Operator:") !== -1, 'Operator should display for multiline.');
test.ok(result.stdout.indexOf('Message: this value should be truthy') !== -1, 'Message should have been displayed.');
test.ok(result.stdout.indexOf('Error: undefined == true') !== -1, 'Error should have been displayed.');
test.done();