Skip to content

Instantly share code, notes, and snippets.

@cosemansp
Last active May 20, 2016 05:50
Show Gist options
  • Save cosemansp/0a6f19b24362f886469b423fdf68a1c1 to your computer and use it in GitHub Desktop.
Save cosemansp/0a6f19b24362f886469b423fdf68a1c1 to your computer and use it in GitHub Desktop.
Typescript for ES6 developers
# Default import from commonJS module
## ES6
import chai, { expect } from 'chai';
import chaiAsPromised from 'chai-as-promised';
chai.use(chaiAsPromised);
## Typescript
import chai = require('chai');
import chaiAsPromised = require('chai-as-promised');
let expect = chai.expect;
chai.use(chaiAsPromised);
## TypesScript (alternative)
import * as chai from 'chai'
import { expect } from 'chai'
import * as chaiAsPromised from 'chai-as-promised'
chai.use(chaiAsPromised);
## To Look at !!??!!
--allowSyntheticDefaultImports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment