Skip to content

Instantly share code, notes, and snippets.

@teppeis
Last active February 16, 2016 17:51
Show Gist options
  • Save teppeis/ea05cc3177d0b8fd42c7 to your computer and use it in GitHub Desktop.
Save teppeis/ea05cc3177d0b8fd42c7 to your computer and use it in GitHub Desktop.
TypeScript + power-assert + ES6 Modules issue http://qiita.com/wadahiro/items/5d8a81252f2105112339
// generated .js
var power_assert_1 = require('power-assert');
var _1 = require('../');
describe('foo', function () {
it('test #1', function () {
power_assert_1.default.ok(_1.default() === 2);
});
});
// original .ts
import assert from 'power-assert';
import sut from '../';
describe('foo', () => {
it('test #1', () => {
assert.ok(sut() === 2);
});
});
@teppeis
Copy link
Author

teppeis commented Feb 16, 2016

一度変数に戻せばいけるけど、このtipsに気づいてもらうのは難しそう。

import powerAssert from 'power-assert';
import sut from '../';

const assert = powerAssert;

describe('foo', () => {
    it('test #1', () => {
        assert.ok(sut() === 2);
    });
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment