commit
681734d208
50
nodejs-vows-supress-stdout.patch
Normal file
50
nodejs-vows-supress-stdout.patch
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
commit ff30573e563482a509d5509e1944fda888b3fb16
|
||||||
|
Author: Tom Hughes <tom@compton.nu>
|
||||||
|
Date: Thu Mar 15 18:47:09 2018 +0000
|
||||||
|
|
||||||
|
Fix stdout redirection for Node 8.x
|
||||||
|
|
||||||
|
Replacing the stdout property on process no longer seems to
|
||||||
|
work fully as console.log still seems to get to the real output
|
||||||
|
stream somehow, so try an alternative approach.
|
||||||
|
|
||||||
|
diff --git a/bin/vows b/bin/vows
|
||||||
|
index ffc6576..4bd8eb6 100755
|
||||||
|
--- a/bin/vows
|
||||||
|
+++ b/bin/vows
|
||||||
|
@@ -6,7 +6,8 @@ var path = require('path'),
|
||||||
|
util = require('util'),
|
||||||
|
glob = require('glob'),
|
||||||
|
NopStream = require('../lib/utils/nopstream').NopStream,
|
||||||
|
- events = require('events');
|
||||||
|
+ events = require('events'),
|
||||||
|
+ stream = require('stream');
|
||||||
|
|
||||||
|
//
|
||||||
|
// Attempt to load Coffee-Script. If it's not available, continue on our
|
||||||
|
@@ -189,18 +190,15 @@ if (options.nocolor) {
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.supressStdout) {
|
||||||
|
- _reporter.setStream && _reporter.setStream(process.stdout);
|
||||||
|
- var devNullStream = null;
|
||||||
|
+ stdout_write = process.stdout.write;
|
||||||
|
|
||||||
|
- if(process.platform === 'win32'){
|
||||||
|
- devNullStream = new NopStream ();
|
||||||
|
- } else {
|
||||||
|
- devNullStream = fs.createWriteStream('/dev/null');
|
||||||
|
- }
|
||||||
|
+ _reporter.setStream && _reporter.setStream(new stream.Writable({
|
||||||
|
+ write: function yyy(chunk, encoding, callback) {
|
||||||
|
+ stdout_write.call(process.stdout, chunk, encoding, callback);
|
||||||
|
+ }
|
||||||
|
+ }));
|
||||||
|
|
||||||
|
- process.__defineGetter__('stdout', function () {
|
||||||
|
- return devNullStream;
|
||||||
|
- });
|
||||||
|
+ process.stdout.write = function xxx(chunk, encoding, callback) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.watch) {
|
||||||
68
nodejs-vows.spec
Normal file
68
nodejs-vows.spec
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
%global enable_tests 1
|
||||||
|
|
||||||
|
Name: nodejs-vows
|
||||||
|
Version: 0.8.2
|
||||||
|
Release: 1
|
||||||
|
Summary: Asynchronous behavior-driven development (BDD) and continuous integration
|
||||||
|
|
||||||
|
License: MIT
|
||||||
|
URL: https://github.com/cloudhead/vows
|
||||||
|
Source0: http://registry.npmjs.org/vows/-/vows-%{version}.tgz
|
||||||
|
# Patch --supress-stdout to work with Node.js 8.x
|
||||||
|
Patch0: nodejs-vows-supress-stdout.patch
|
||||||
|
BuildArch: noarch
|
||||||
|
ExclusiveArch: %{nodejs_arches} noarch
|
||||||
|
|
||||||
|
BuildRequires: nodejs-packaging
|
||||||
|
|
||||||
|
%if 0%{?enable_tests}
|
||||||
|
BuildRequires: coffee-script npm(diff) npm(eyes) npm(glob)
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%description
|
||||||
|
Vows is an asynchronous behavior-driven development (BDD) framework for
|
||||||
|
Node.js.
|
||||||
|
|
||||||
|
Vows was built from the ground up to test asynchronous code. It
|
||||||
|
executes your tests in parallel when it makes sense, and sequentially
|
||||||
|
when there are dependencies. Emphasis was put on speed of execution,
|
||||||
|
clarity and user experience.
|
||||||
|
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -p 1 -n package
|
||||||
|
%nodejs_fixdep glob "^6.0.3"
|
||||||
|
|
||||||
|
|
||||||
|
%build
|
||||||
|
#nothing to do
|
||||||
|
|
||||||
|
|
||||||
|
%install
|
||||||
|
mkdir -p %{buildroot}%{nodejs_sitelib}/vows
|
||||||
|
cp -pr package.json lib/ %{buildroot}%{nodejs_sitelib}/vows
|
||||||
|
mkdir -p %{buildroot}%{nodejs_sitelib}/vows/bin
|
||||||
|
install -p -D -m0755 bin/vows %{buildroot}%{nodejs_sitelib}/vows/bin/vows
|
||||||
|
mkdir -p %{buildroot}%{_bindir}
|
||||||
|
ln -sf %{nodejs_sitelib}/vows/bin/vows %{buildroot}%{_bindir}/vows
|
||||||
|
mkdir -p %{buildroot}%{_mandir}/man1
|
||||||
|
%nodejs_symlink_deps
|
||||||
|
|
||||||
|
|
||||||
|
%if 0%{?enable_tests}
|
||||||
|
%check
|
||||||
|
%nodejs_symlink_deps --check
|
||||||
|
./bin/vows test/*.js
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
|
%files
|
||||||
|
%doc README.md
|
||||||
|
%license LICENSE
|
||||||
|
%{nodejs_sitelib}/vows
|
||||||
|
%{_bindir}/vows
|
||||||
|
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Wed Aug 12 2020 wangxiao <wangxiao65@huawei.com> - 0.8.2-1
|
||||||
|
- package init
|
||||||
5
nodejs-vows.yaml
Normal file
5
nodejs-vows.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
git_url: https://github.com/cloudhead/vows
|
||||||
|
version_control: github
|
||||||
|
src_repo: cloudhead/vows
|
||||||
|
tag_prefix: "^v"
|
||||||
|
seperator: "."
|
||||||
BIN
vows-0.8.2.tgz
Normal file
BIN
vows-0.8.2.tgz
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user