modify Source
This commit is contained in:
parent
c29bffb865
commit
f077292cf9
Binary file not shown.
BIN
nodejs-has-color-0.1.7.tar.gz
Normal file
BIN
nodejs-has-color-0.1.7.tar.gz
Normal file
Binary file not shown.
@ -1,15 +1,17 @@
|
|||||||
%{?nodejs_find_provides_and_requires}
|
%{?nodejs_find_provides_and_requires}
|
||||||
%global enable_tests 1
|
%global enable_tests 1
|
||||||
|
%global packagename supports-color
|
||||||
|
|
||||||
Name: nodejs-has-color
|
Name: nodejs-has-color
|
||||||
Version: 0.1.7
|
Version: 0.1.7
|
||||||
Release: 1
|
Release: 1
|
||||||
Summary: Detects whether a terminal supports color
|
Summary: Detects whether a terminal supports color
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://github.com/sindresorhus/has-color
|
URL: https://github.com/chalk/supports-color
|
||||||
Source0: http://registry.npmjs.org/has-color/-/has-color-%{version}.tgz
|
#https://codeload.github.com/chalk/supports-color/tar.gz/v0.1.7
|
||||||
Source1: https://raw.githubusercontent.com/sindresorhus/has-color/ab671b1f74846d9fb9caea8dc302603a865be3cc/test.js
|
Source0: %{name}-%{version}.tar.gz
|
||||||
#https://opensource.org.licenses/MIT
|
#https://opensource.org.licenses/MIT
|
||||||
Source2: LICENSE
|
Source1: LICENSE
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
ExclusiveArch: %{nodejs_arches} noarch
|
ExclusiveArch: %{nodejs_arches} noarch
|
||||||
BuildRequires: nodejs-packaging
|
BuildRequires: nodejs-packaging
|
||||||
@ -20,9 +22,8 @@ BuildRequires: npm(mocha)
|
|||||||
%{summary}.
|
%{summary}.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n package
|
%setup -q -n %{packagename}-%{version}
|
||||||
cp -p %{SOURCE1} .
|
cp -p %{SOURCE1} .
|
||||||
cp -p %{SOURCE2} .
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
|
|||||||
30
test.js
30
test.js
@ -1,30 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
var assert = require('assert');
|
|
||||||
|
|
||||||
beforeEach(function () {
|
|
||||||
// clear the cache of the tested module
|
|
||||||
delete require.cache[require.resolve('./index')];
|
|
||||||
process.stdout.isTTY = true;
|
|
||||||
process.argv = [];
|
|
||||||
process.env = {};
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return false if not TTY', function () {
|
|
||||||
process.stdout.isTTY = false;
|
|
||||||
assert.equal(require('./index'), false);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return false if --no-color flag is used', function () {
|
|
||||||
process.argv = ['--no-color'];
|
|
||||||
assert.equal(require('./index'), false);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return true if --color flag is used', function () {
|
|
||||||
process.argv = ['--color'];
|
|
||||||
assert.equal(require('./index'), true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return true if `COLORTERM` is in env', function () {
|
|
||||||
process.env.COLORTERM = true;
|
|
||||||
assert.equal(require('./index'), true);
|
|
||||||
});
|
|
||||||
Loading…
x
Reference in New Issue
Block a user