-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Add babel-plugin for object spread syntax to babel-preset-jest #4519
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Makes sense! |
@digitalkaoz that's probably because the istanbul instrumentation is outdated on your end. What does |
@SimenB it seems i have 1.8.0
|
Hmm, that's odd. What error are you getting? |
|
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. |
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