Chai import in Typescript

I am trying to use chai in typescript.

The jai jai example shows this as:

var should = require('chai').should();

      

I downloaded the type definition:

tsd install chai

      

... refers to a file, tried to import

/// <reference path='../typings/chai/chai.d.ts' />
import should = require('chai').should();

      

I get:

error TS1005: ';' expected

      

... any idea how to do this?

+3


source to share


2 answers


tests to type chai do the following:

import chai = require('chai');
var should = chai.should();

      



Does this work for you?

+4


source


import { should } from 'chai';
should();

      



+2


source







All Articles