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

adds modifyBabelConfig #235

Closed
wants to merge 12 commits into from
Closed

adds modifyBabelConfig #235

wants to merge 12 commits into from

Conversation

jaredmcdonald
Copy link
Contributor

fixes #134

adds a modifyBabelConfig callback in kyt.config.js

if (config.debug) {
logger.debug('Merged babel configuration:', mergedBabelrc);
}
return mergedBabelrc;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a misnomer right? There's no actual merging going on.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, maybe modifiedBabelConfig would be more accurate?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea that sounds good

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tizmagik - done

describe('preprocessor', () => {
it('calls the babel utility and babel-jest\'s createTransformer', () => {
const preprocessor = require('../preprocessor'); // eslint-disable-line global-require
expect(preprocessor).toBe(fakeTransformer);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this just testing Jest's ability to mock?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ha yeah I suppose, I'll drop this assertion

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

although, wait, I added it to verify that preprocessor exports the result of createTransformer

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok gotcha!

});
expect(babelJest.createTransformer).toBeCalledWith(fakeBabelResult);
});
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this test!! 🙏

Copy link
Contributor

@tizmagik tizmagik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@delambo
Copy link
Member

delambo commented Oct 16, 2016

Can we pause this? I'd like to see how #250 feels first.

@jaredmcdonald
Copy link
Contributor Author

jaredmcdonald commented Oct 16, 2016

sounds good to me @delambo -- I'll close the PR for now, can always reopen

@jaredmcdonald jaredmcdonald deleted the modify-babel-config branch December 16, 2016 19:53
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.

Refactor how Babel configuration is loaded in
4 participants