Add babel-plugin for object spread syntax to babel-preset-jest#4519
Merged
cpojer merged 1 commit intojestjs:masterfrom Sep 21, 2017
Merged
Add babel-plugin for object spread syntax to babel-preset-jest#4519cpojer merged 1 commit intojestjs:masterfrom
cpojer merged 1 commit intojestjs:masterfrom
Conversation
Member
|
Makes sense! |
Member
Author
|
@digitalkaoz that's probably because the istanbul instrumentation is outdated on your end. What does |
|
@SimenB it seems i have 1.8.0 |
Member
Author
|
Hmm, that's odd. What error are you getting? |
|
Member
Author
|
I can't reproduce on my machine. index.js const obj = {
foo: 'bar'
};
module.exports = {
...obj,
foobar: 'baz'
};test.js: const file = require('./');
test('something', () => {
expect(file).toEqual({
foo: 'bar',
foobar: 'baz'
});
});$ yarn jest --coverage
PASS ./test.js
✓ something (3ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 0.787s, estimated 1s
Ran all test suites.
----------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
----------|----------|----------|----------|----------|----------------|
All files | 100 | 100 | 100 | 100 | |
index.js | 100 | 100 | 100 | 100 | |
----------|----------|----------|----------|----------|----------------|On node 8.6.0 |
|
mh same setup here, gives me: |
|
mh if i install @SimenB any idea on this? |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Seems like the easiest fix to #4248.
(typos in the commit message are the best)
Test plan
Running this version makes tests using object spread on node 8 pass without manually including the babel plugin there. Note that this doesn't transpile the syntax, it only allows babel to parse it.
Not sure if a test in this repo makes sense as it already gets that syntax plugin transitively in its own
.babelrc