TypeScript Community Stubs for Should/Mocha

Windows 7., PhpStorm 8.0.3

var assert = require('assert');
describe('Array', function() {
    describe('#indexOf()', function () {
        it('should return -1 when the value is not present', function () {
            assert.equal(-1, [1,2,3].indexOf(5));
            
assert.equal(-1, [1,2,3].indexOf(0));
        
});
    
});
});


I wanted to turn on  autocomplete for the {describe, it, assert} but  have problem.

Downloaded and installed the mocha-DefinitelyTyped stub which doesn't seem to be working.

Can't find the Should TypeScript Stub.

0

I'd suggest downloading jasmine typescript stubs instead of mocha. For WebStorm 11/PHPStorm 10, having
jasmine.d.ts + Node.js Core modules library enabled is enough to get all your methods recognized

0

Ok, that change it.

So what if the people behind the project are using mocha/chai/sinon?

0

Hmm... Not sure I understand what you are asking about - can you be more specific?


0

Are you saying don't use mocha or that loading those stubs is good for mocha?

Suppose there is an existing project that is using mocha, chai, sinon.  Are you saying I am out of luck with this and have to change it to jasmine?

I don't want to be forced to use jasmine.

0
Are you saying don't use mocha or that loading those stubs is good for mocha?

Loading these stubs is good for mocha, as the basic describe and BDD patterns are about the same. Or, don't use any libraries, just make sure to install mocha node modules locally - WebStorm will use them for completion

0

请先登录再写评论。