在本例中,是由NPM模块colors定义的方法。it('should only apply colors if enable in the .ENV file', function () {
var stringGreyStub = sinon.stub但是,stringGreyStub.called的值仍然是false。你知道我会做错什么吗?
我在我的规范中使用sinon,并将它包括在中描述的Brocfile中。这是可行的,我可以在我的规格中使用sinon。unit/views/edit-todo-test.js: line 11, col 18, 'sinon' is not defined.我可以通过在规范中声明sinon是全局的来解决这个问题:
/* global sinon