Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mocha でテストを実行すると背景色によってはスタックトレースが見えない #29

Closed
okkez opened this issue Jul 28, 2017 · 9 comments
Assignees

Comments

@okkez
Copy link
Contributor

okkez commented Jul 28, 2017

Gnome terminal で solarized dark という配色にしているが、mocha で JS のテストを実行するとスタックトレースが見えない。mocha側できちんと背景色を指定すればいいはず。

screenshot from 2017-07-28 12-58-23

@piroor
Copy link
Member

piroor commented Aug 4, 2017

http://d.hatena.ne.jp/tatanaideyo/20130122/1358872017 の手順を参考にUbuntu 16.04LTSで設定してみたところ、再現した。

@piroor
Copy link
Member

piroor commented Aug 4, 2017

組み込みのスキーム「Solarized Dark」
配色「Solarized」
にすると、文字が読めなくなる。パレット左下の色(パレットエントリ9)が背景色と同じなのが原因のようだ。

@piroor
Copy link
Member

piroor commented Aug 7, 2017

lib/reporters/base.js

exports.colors = {
  pass: 90,
  fail: 31,
  'bright pass': 92,
  'bright fail': 91,
  'bright yellow': 93,
  pending: 36,
  suite: 0,
  'error title': 0,
  'error message': 31,
  'error stack': 90,
  checkmark: 32,
  fast: 90,
  medium: 33,
  slow: 31,
  green: 32,
  light: 90,
  'diff gutter': 90,
  'diff added': 32,
  'diff removed': 31
};

ここで90番の色が設定されている箇所が、背景と同じ色なので見えなくなっている。

@piroor
Copy link
Member

piroor commented Aug 7, 2017

こんな風に強引に背景色を指定してみると、一応読めるようにはなった。

exports.colors = {
  pass: '90;101',
  fail: 31,
  'bright pass': 92,
  'bright fail': 91,
  'bright yellow': 93,
  pending: 36,
  suite: 0,
  'error title': 0,
  'error message': 31,
  'error stack': '90;101',
  checkmark: 32,
  fast: '90;101',
  medium: 33,
  slow: 31,
  green: 32,
  light: '90;101',
  'diff gutter': '90;101',
  'diff added': 32,
  'diff removed': 31
};

@cosmo0920
Copy link
Contributor

ざっと目を通しましたがなんだかやり取りが噛み合ってないですね。
Solarizedを使っている人はSolarizedサイコーって感じですが、
mochaのメンテナはSolarizedの色は変なのでは、と言っているので説得するの難しそうですね。
ここまでざっと読んだ個人的な所感ですが、色の彩度とか色相とかそういうので論理的に攻めるしかなさそう。

@piroor
Copy link
Member

piroor commented Aug 7, 2017

ありがとうございます、議論がどういうことになってるのか長すぎてまだ把握できてませんでした……

@piroor
Copy link
Member

piroor commented Aug 7, 2017

mochajs/mocha#2946, mochajs/mocha#2945 として報告したためこちらは閉じます。

@piroor piroor closed this as completed Aug 7, 2017
@cosmo0920
Copy link
Contributor

CLA(Contributor License Agreement)もサインしておくと良いと思いますよ!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants