I wrote my mocha test in Typescript, and now I'm compiling it in es6
tsc *.ts --target es6 -m commonjs --watch
I get NO error in the console,
But in the WebStorm I get underlined every 'should' chai-keyword with red (when I hover it I get a message: ts2339: property 'should' does not exist on type Bluebird).
for example I'm using 'chai' and I want to check is expected value true:
import * as chai from "chai";
export class WrapedChai {
public shouldBeTrue(valueToTest : any){
let expectedValue : boolean = true;
expectedValue.should.equal(valueToTest);
}
// or usintg SHOULD with a Promise
public belongsToGLOErrorPromise(valueToTest: any) {
let expectedValue : boolean = true;
return Promise.resolve(expectedValue).should.eventually.equal(valueToTest);
}
}
and should is always underlined in red.
I tried this:
import { should } from 'chai';
should();
and this:
import chai = require('chai');
var should = chai.should();
but 'should' stil stays underlined as an error.