Resolving JavaScript Function References

I have a test basic test suite file called app.unit.js:

'app', function() {
    describe('initialize', function() {
        it('should do stuff', function() {
            expect(true).to.be.true;
        
});
    
});
});


When I open it in IDEA IntellJ 14 it cannot find references for describe, it, or be. I tried inserting a Visual Studio style reference:

/// <reference path="../components/mocha/mocha.js" />


But it doesn't seem to pick up the reference.  The library comes in via bower and there is an project-level entry in Settings > Languages & Frameworks > JavaScript > Libraries for the bower components folder.  I would expect that this is all that is necessary to do reference resolution.  This seems like basic functionality.  Any advice on how to get it working?  It just works in Visual Studio.

1 comment
Comment actions Permalink

Hi Colin,
Our JS engine considers 'describe', 'it' and other mocha symbols as CommonJS module symbols, which are expected to be referenced via require call. Unfortunately, we haven't got special mocha handling for this case. As a workaround, you can download TypeScript mocha definition, please take a look at WEB-10066.

0

Please sign in to leave a comment.