Skip to content

Conversation

@sindresorhus
Copy link
Member

since we're only using this once per file now

http://babeljs.io/docs/usage/options/#options

@sindresorhus
Copy link
Member Author

@vdemedes Any thoughts on how to best test to ensure that this is working correctly? Meaning it only transpiles the tested files and nothing more.

@vadimdemedes
Copy link
Contributor

Well, if we are executing babel per file, we should just set file name to only property.
whitelist property is not for files, it is a list of transform to include.

@vadimdemedes
Copy link
Contributor

@sindresorhus Does passing a string to only, instead of a pattern, works?

@sindresorhus sindresorhus changed the title use the test file path in the Babel whitelist instead of a pattern use the test file path in the Babel only prop instead of a pattern Sep 18, 2015
@sindresorhus
Copy link
Member Author

By whitelist I meant only.

@sindresorhus
Copy link
Member Author

Does passing a string to only, instead of a pattern, works?

It should in theory as the prop is being arrayified, but we need a test for the behavior anyways.

@sindresorhus sindresorhus modified the milestone: 0.3.0 Sep 23, 2015
@ahdinosaur
Copy link

what about for projects that are using babel to transpile the rest of their app (e.g. by running their code with babel-node), wouldn't this force babel to only transpile the test files?

@sindresorhus sindresorhus self-assigned this Oct 15, 2015
@sindresorhus
Copy link
Member Author

what about for projects that are using babel to transpile the rest of their app (e.g. by running their code with babel-node), wouldn't this force babel to only transpile the test files?

We already limit that in master. This PR only changes it to only ignore the path explicitly instead of using a ignore pattern. You would just do whatever you with your existing test framework that doesn't support ES2015 builtin, not sure what that is?

vadimdemedes pushed a commit that referenced this pull request Oct 25, 2015
use the test file path in the Babel `only` prop instead of a pattern
@vadimdemedes vadimdemedes merged commit 18c5887 into master Oct 25, 2015
@vadimdemedes vadimdemedes deleted the babel-only branch October 25, 2015 08:08
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.

5 participants