Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(power-assert): use CommonJS style default export statement #8127

Merged
merged 1 commit into from Feb 17, 2016

Conversation

teppeis
Copy link
Contributor

@teppeis teppeis commented Feb 17, 2016

If ES6 style import statement is used in .ts, an assertion expression is compiled to the format that is not supported by power-assert like power_assert_1.default.ok().

For examlple,

// original .ts
import assert from 'power-assert';
import sut from '../';

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

is compiled to

// 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);
    });
});

To resolve this problem, this PR changes to use CommonJS Style default export simply.

@dt-bot
Copy link
Member

dt-bot commented Feb 17, 2016

power-assert/power-assert.d.ts

to author (@vvakame). Could you review this PR?
👍 or 👎?

Checklist

  • pass the Travis CI test?

@teppeis
Copy link
Contributor Author

teppeis commented Feb 17, 2016

cc/ @twada

@twada
Copy link

twada commented Feb 17, 2016

@teppeis Thank you so much!!

vvakame added a commit that referenced this pull request Feb 17, 2016
fix(power-assert): use CommonJS style default export statement
@vvakame vvakame merged commit b57c33f into DefinitelyTyped:master Feb 17, 2016
@vvakame
Copy link
Member

vvakame commented Feb 17, 2016

👍

@teppeis teppeis deleted the fix-power-assert-module branch February 17, 2016 05:45
@teppeis
Copy link
Contributor Author

teppeis commented Feb 17, 2016

@vvakame thanks!

wadahiro added a commit to wadahiro/typescript-library-boilerplate that referenced this pull request Feb 17, 2016
In addition, we don't need to use old power-assert.d.ts now.
see DefinitelyTyped/DefinitelyTyped#8127
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants