diff --git a/nodejs-proxyquire-helloworld.patch b/nodejs-proxyquire-helloworld.patch new file mode 100644 index 0000000..202039b --- /dev/null +++ b/nodejs-proxyquire-helloworld.patch @@ -0,0 +1,28 @@ +commit c0121c386f613d4db744159d875ebfccc345c778 +Author: Tom Hughes +Date: Fri Jan 27 00:27:02 2017 +0000 + + Drop test that needs native-hello-world + +diff --git a/test/proxyquire-global.js b/test/proxyquire-global.js +index e09fce6..29999df 100644 +--- a/test/proxyquire-global.js ++++ b/test/proxyquire-global.js +@@ -39,17 +39,6 @@ describe('global flags set', function () { + assert.equal(realFoo(), false) + assert.equal(proxiedFoo(), true) + }) +- +- it('should not throw when a native module is required a second time', function () { +- var stubs = { +- 'foo': { +- '@global': true +- } +- } +- +- proxyquire('native-hello-world', stubs) +- proxyquire('native-hello-world', stubs) +- }) + }) + + describe('global flags not set', function () { diff --git a/nodejs-proxyquire.spec b/nodejs-proxyquire.spec new file mode 100644 index 0000000..95de895 --- /dev/null +++ b/nodejs-proxyquire.spec @@ -0,0 +1,40 @@ +Name: nodejs-proxyquire +Version: 2.0.1 +Release: 1 +Summary: Proxies Node.js require to allow overriding dependencies +License: MIT +URL: https://github.com/thlorenz/proxyquire +Source0: http://registry.npmjs.org/proxyquire/-/proxyquire-%{version}.tgz +Patch0: nodejs-proxyquire-helloworld.patch +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch +BuildRequires: nodejs-packaging +BuildRequires: npm(fill-keys) npm(module-not-found-error) npm(mocha) npm(resolve) npm(should) +%description +Proxies Node,js's require in order to make overriding dependencies +during testing easy while staying totally unobstrusive. + +%prep +%autosetup -p 1 -n package +%nodejs_fixdep resolve "^1.1.7" +rm -rf node_modules + +%build + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/proxyquire +cp -pr package.json index.js lib %{buildroot}%{nodejs_sitelib}/proxyquire +%nodejs_symlink_deps + +%check +%nodejs_symlink_deps --check +%{nodejs_sitelib}/mocha/bin/mocha + +%files +%doc README.md examples +%license LICENSE +%{nodejs_sitelib}/proxyquire + +%changelog +* Fri Aug 21 2020 wangchong - 2.0.1-1 +- package init diff --git a/nodejs-proxyquire.yaml b/nodejs-proxyquire.yaml new file mode 100644 index 0000000..a3211b7 --- /dev/null +++ b/nodejs-proxyquire.yaml @@ -0,0 +1,4 @@ +version-control: github +src_repo: thlorenz/proxyquire +tag_prefix: ^v +seperator: . diff --git a/proxyquire-2.0.1.tgz b/proxyquire-2.0.1.tgz new file mode 100644 index 0000000..096208e Binary files /dev/null and b/proxyquire-2.0.1.tgz differ