Skip to content

Commit

Permalink
Upgrade dependency supports-color
Browse files Browse the repository at this point in the history
  • Loading branch information
mroderick committed Jan 13, 2018
1 parent 7c3cb4f commit fcf967b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/sinon/color.js
Expand Up @@ -3,7 +3,7 @@
var supportsColor = require("supports-color");

function colorize(str, color) {
if (!supportsColor) {
if (supportsColor.stdout === false) {
return str;
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -42,7 +42,7 @@
"lodash.get": "^4.4.2",
"lolex": "^2.2.0",
"nise": "^1.2.0",
"supports-color": "^4.4.0",
"supports-color": "^5.1.0",
"type-detect": "^4.0.5"
},
"devDependencies": {
Expand Down
10 changes: 7 additions & 3 deletions test/util/core/color-test.js
Expand Up @@ -19,7 +19,9 @@ describe("color", function () {

beforeEach(function () {
color = proxyquire("../../../lib/sinon/color", {
"supports-color": {}
"supports-color": {
stdout: true
}
});
});

Expand All @@ -40,13 +42,15 @@ describe("color", function () {

beforeEach(function () {
color = proxyquire("../../../lib/sinon/color", {
"supports-color": false
"supports-color": {
stdout: false
}
});
});

getColorMethods().forEach(function (method) {
describe(method.name, function () {
it("should return a colored string", function () {
it("should return a regular string", function () {
var string = "lorem ipsum";
var actual = color[method.name](string);

Expand Down

0 comments on commit fcf967b

Please sign in to comment.