Skip to content

Commit

Permalink
Drop support for Node.js 0.10 and 0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed May 21, 2017
1 parent 0d21449 commit 9b60021
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Expand Up @@ -7,6 +7,6 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{package.json,*.yml}]
[*.yml]
indent_style = space
indent_size = 2
1 change: 1 addition & 0 deletions .gitattributes
@@ -1 +1,2 @@
* text=auto
*.js text eol=lf
2 changes: 0 additions & 2 deletions .travis.yml
Expand Up @@ -3,6 +3,4 @@ language: node_js
node_js:
- '6'
- '4'
- '0.12'
- '0.10'
after_success: npm run coveralls
4 changes: 2 additions & 2 deletions example.js
@@ -1,7 +1,7 @@
'use strict';
const chalk = require('./');
const chalk = require('.');

// generates screenshot
// Generates screenshot
for (const key of Object.keys(chalk.styles)) {
let ret = key;

Expand Down
8 changes: 4 additions & 4 deletions package.json
Expand Up @@ -10,7 +10,7 @@
"JD Ballard <i.am.qix@gmail.com> (github.com/qix-)"
],
"engines": {
"node": ">=0.10.0"
"node": ">=4"
},
"scripts": {
"test": "xo && nyc mocha",
Expand Down Expand Up @@ -50,11 +50,11 @@
},
"devDependencies": {
"coveralls": "^2.11.2",
"import-fresh": "^2.0.0",
"matcha": "^0.7.0",
"mocha": "*",
"nyc": "^6.1.1",
"require-uncached": "^1.0.2",
"resolve-from": "^2.0.0",
"nyc": "^10.3.2",
"resolve-from": "^3.0.0",
"semver": "^5.1.0",
"xo": "^0.16.0"
},
Expand Down
14 changes: 7 additions & 7 deletions test.js
@@ -1,9 +1,9 @@
'use strict';
var assert = require('assert');
var requireUncached = require('require-uncached');
var importFresh = require('import-fresh');
var resolveFrom = require('resolve-from');
var semver = require('semver');
var chalk = require('./');
var chalk = require('.');

describe('chalk', function () {
it('should style string', function () {
Expand Down Expand Up @@ -103,31 +103,31 @@ describe('chalk on windows', function () {

it('should replace blue foreground color in cmd.exe', function () {
process.env.TERM = 'dumb';
var chalkCtx = requireUncached('./');
var chalkCtx = importFresh('.');
assert.equal(chalkCtx.blue('foo'), '\u001b[94mfoo\u001b[39m');
});

it('shouldn\'t replace blue foreground color in xterm based terminals', function () {
process.env.TERM = 'xterm-256color';
var chalkCtx = requireUncached('./');
var chalkCtx = importFresh('.');
assert.equal(chalkCtx.blue('foo'), '\u001b[34mfoo\u001b[39m');
});

it('should not apply dimmed styling on gray strings, see https://github.com/chalk/chalk/issues/58', function () {
process.env.TERM = 'dumb';
var chalkCtx = requireUncached('./');
var chalkCtx = importFresh('.');
assert.equal(chalkCtx.gray.dim('foo'), '\u001b[90mfoo\u001b[22m\u001b[39m');
});

it('should apply dimmed styling on xterm compatible terminals', function () {
process.env.TERM = 'xterm';
var chalkCtx = requireUncached('./');
var chalkCtx = importFresh('.');
assert.equal(chalkCtx.gray.dim('foo'), '\u001b[90m\u001b[2mfoo\u001b[22m\u001b[39m');
});

it('should apply dimmed styling on strings of other colors', function () {
process.env.TERM = 'dumb';
var chalkCtx = requireUncached('./');
var chalkCtx = importFresh('.');
assert.equal(chalkCtx.blue.dim('foo'), '\u001b[94m\u001b[2mfoo\u001b[22m\u001b[39m');
});
});
Expand Down

0 comments on commit 9b60021

Please sign in to comment.