package init

This commit is contained in:
zhanghua1831 2020-08-20 10:25:13 +08:00
parent 9170799a51
commit ba64778edd
4 changed files with 97 additions and 0 deletions

View File

@ -0,0 +1,47 @@
commit a469eda0f464455e72447106c15519654a053367
Author: Tom Hughes <tom@compton.nu>
Date: Fri Jan 1 17:31:43 2016 +0000
Update tests for newer versions of tape
The t.same call now does strict equality at the lowest level.
diff --git a/package.json b/package.json
index ed9a287..86ed349 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,7 @@
"test" : "test"
},
"devDependencies" : {
- "tape" : "~1.0.4"
+ "tape" : "~4.4.0"
},
"scripts" : {
"test" : "tape test/*.js"
diff --git a/test/circular.js b/test/circular.js
index f56506a..8e283ce 100644
--- a/test/circular.js
+++ b/test/circular.js
@@ -27,7 +27,7 @@ test('deepCirc', function (t) {
traverse(obj).forEach(function (x) {
if (this.circular) {
t.same(this.circular.path, []);
- t.same(this.path, [ 'y', 2 ]);
+ t.same(this.path, [ 'y', '2' ]);
}
});
});
@@ -44,10 +44,10 @@ test('doubleCirc', function (t) {
}
});
- t.same(circs[0].self.path, [ 'x', 3, 2 ]);
+ t.same(circs[0].self.path, [ 'x', '3', '2' ]);
t.same(circs[0].circ.path, []);
- t.same(circs[1].self.path, [ 'y', 2 ]);
+ t.same(circs[1].self.path, [ 'y', '2' ]);
t.same(circs[1].circ.path, []);
t.same(circs.length, 2);

46
nodejs-traverse.spec Normal file
View File

@ -0,0 +1,46 @@
%{?nodejs_find_provides_and_requires}
%global enable_tests 1
Name: nodejs-traverse
Version: 0.6.6
Release: 1
Summary: Traverse and transform objects
License: MIT
URL: https://github.com/substack/js-traverse
Source0: https://registry.npmjs.org/traverse/-/traverse-%{version}.tgz
# https://github.com/substack/js-traverse/pull/51
Patch0: nodejs-traverse-tape.patch
BuildArch: noarch
ExclusiveArch: %{nodejs_arches} noarch
BuildRequires: nodejs-packaging
%if 0%{?enable_tests}
BuildRequires: npm(tap) npm(tape)
%endif
%description
Traverse and transform objects by visiting every node on a recursive walk.
%prep
%autosetup -p 1 -n package
chmod 0644 examples/*
%build
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/traverse
cp -pr package.json index.js %{buildroot}%{nodejs_sitelib}/traverse
%nodejs_symlink_deps
%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
%tap test/*.js
%endif
%files
%{!?_licensedir:%global license %doc}
%doc examples readme.markdown
%license LICENSE
%{nodejs_sitelib}/traverse
%changelog
* Tue Aug 11 2020 zhanghua <zhanghua40@huawei.com> - 0.6.6-1
- package init

4
nodejs-traverse.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: substack/js-traverse
tag_pattern: "^"
seperator: "."

BIN
traverse-0.6.6.tgz Normal file

Binary file not shown.