Skip to content

Commit

Permalink
adding test for VSCODE
Browse files Browse the repository at this point in the history
  • Loading branch information
Wei-Wei Wu committed Feb 28, 2018
1 parent 1a6f8b2 commit 1000693
Show file tree
Hide file tree
Showing 4 changed files with 4,292 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/weiwei.js"
}
]
}
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ function supportsColor(stream) {
return 2;
}

if (env.VSCODE_PID) {
return 1;
}

if (stream && !stream.isTTY && forceColor !== true) {
return 0;
}
Expand Down
10 changes: 10 additions & 0 deletions weiwei.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const supportsColor = require('.');

// supportsColor.stdout
// console.log(Object.keys(process.env))
// console.log(process.stdout.isTTY)
// console.log(process.stdout.isRaw)
// console.log(process.stdout)
// console.log(process.env)

console.log(supportsColor.stdout)
Loading

0 comments on commit 1000693

Please sign in to comment.