【发布时间】:2014-12-17 19:37:49
【问题描述】:
希望您能提供帮助,最近从 jshint 转移到 eslint,我想看看如何在不进行更改的情况下让我的测试通过;
以下面的测试为例
expect(ctrl.screens).to.not.be.undefined;
eshint 抱怨以下期望;
error Expected an assignment or function call and instead saw an expression no-unused-expressions
将测试更改为;
expect(ctrl.screens).to.not.be.undefined();
给出以下错误:
TypeError: '[object Object]' is not a function (evaluating 'expect(ctrl.screens).to.not.be.undefined()')
任何想法在这里采取什么方法?当我从任务列表中删除 eshint 时,所有测试都通过了,所以我需要一些方法来清理这些测试。
J
【问题讨论】:
标签: node.js unit-testing jshint