Add babel-plugin for object spread syntax to babel-preset-jest#4519
Add babel-plugin for object spread syntax to babel-preset-jest#4519cpojer merged 1 commit intojestjs:masterfrom
Conversation
|
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. |
|
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