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

Investigate if object rest works correctly in tests on master #904

Closed
gaearon opened this issue Oct 14, 2016 · 5 comments · Fixed by #927
Closed

Investigate if object rest works correctly in tests on master #904

gaearon opened this issue Oct 14, 2016 · 5 comments · Fixed by #927
Milestone

Comments

@gaearon
Copy link
Contributor

gaearon commented Oct 14, 2016

I want to hold off releasing 0.7.0 until we figure out if this is an issue: #892 (comment).

I would appreciate help trying to reproduce this in tests in master, and if it reproduces, a fix. I presume that the fix would include whitelisting destructuring transform regardless of Node version.

@gaearon gaearon added this to the 0.7.0 milestone Oct 14, 2016
@gaearon gaearon changed the title Investigate if object rest works correctly in tests Investigate if object rest works correctly in tests on master Oct 14, 2016
@gaearon
Copy link
Contributor Author

gaearon commented Oct 18, 2016

To provide more context:

@JeffreyATW
Copy link
Contributor

I have Node 6.7.0 installed. Checked out master and created a my-app project. Modified the App.test.js like so:

it('renders without crashing', () => {
  const obj = {
    a: 'a',
    b: 'b',
    c: 'c'
  };

  const { a, ...z } = obj;

  console.log(a);
  console.log(z);

  const div = document.createElement('div');
  ReactDOM.render(<App />, div);
});

Got a SyntaxError:

 FAIL  src/App.test.js
  ● Test suite failed to run

    /Users/jeffreyatw/Documents/repos/create-react-app/testo/src/App.test.js:12
      const { a, ...z } = obj;
                 ^^^
    SyntaxError: Unexpected token ...

      at transformAndBuildScript (node_modules/jest-runtime/build/transform.js:284:10)
      at process._tickCallback (internal/process/next_tick.js:103:7)

@paulyoung
Copy link

I imagine this is blocked by babel/babel#4074

@hzoo
Copy link

hzoo commented Oct 19, 2016

@gaearon will work on fixing it in babel next babel/babel#4755

@hzoo
Copy link

hzoo commented Nov 16, 2016

Fixed in babel-plugin-transform-object-rest-spread@6.19.0

@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants