【问题标题】:Mocha invisible descriptions摩卡隐形描述
【发布时间】:2017-09-05 19:03:24
【问题描述】:

摩卡测试的体验问题。不知何故,测试描述是不可见的。我不能用鼠标选择它们,它们只是不可见的。

摩卡测试文件:

const app = require('../../server');

const expect = require('chai').expect;

describe('Unit', function() {
  describe('server', function() {
    it('env should stay test', function() {
      expect(process.env.NODE_ENV).to.be.eq('test');
    });

    it('should set uptime', function() {
      expect(typeof Date.parse(global.app_started)).to.be.eq('number');
    });

    it('should set app status to DOWN', function() {
      expect(global.app_status).to.be.eq('DOWN');
    });
  });
});

输出如下:

我的环境:

node -v // 8.1.3
npm -v // 5.0.3

感谢有关此问题的任何建议。

【问题讨论】:

  • 我已经使用摩卡多年了。以前从未见过这种情况,并且无法使用您在问题中提供的信息进行复制。前进的方向是在您的问题中包含minimal reproducible example
  • @Lazyexpert 这看起来像是终端应用程序配置问题,可能转到终端>首选项?
  • @ehacinom 好点,我一回家就检查。

标签: node.js unit-testing mocha.js chai


【解决方案1】:

就像在 cmets 中一样,这看起来像是终端应用程序配置问题。您可以在 Terminal > Preferences 更改不同类型 shell 输出的颜色。

【讨论】:

  • 我确信,如果问题出在颜色上 - 当我用鼠标选择它时,我可以看到文本。对我来说非常奇怪的行为。
猜你喜欢
  • 1970-01-01
  • 2015-12-22
  • 1970-01-01
  • 2018-12-02
  • 1970-01-01
  • 2018-06-27
  • 1970-01-01
  • 2022-10-20
相关资源
最近更新 更多