Skip to content

Instantly share code, notes, and snippets.

@valscion
Last active November 17, 2016 14:13
Show Gist options
  • Save valscion/25989e714380f2eabe52d170d6ca6f41 to your computer and use it in GitHub Desktop.
Save valscion/25989e714380f2eabe52d170d6ca6f41 to your computer and use it in GitHub Desktop.
#create-react-app/1052 example
diff --git a/packages/react-scripts/template/src/App.test.js b/packages/react-scripts/template/src/App.test.js
index b84af98..8cefbcf 100644
--- a/packages/react-scripts/template/src/App.test.js
+++ b/packages/react-scripts/template/src/App.test.js
@@ -3,6 +3,12 @@ import ReactDOM from 'react-dom';
import App from './App';
it('renders without crashing', () => {
+ const fn = ({ a, ...otherProps }) => otherProps;
+
+ fn({ a: 1, b: 2 });
+
+ console.log(fn({ a: 1, b: 2 }));
+
const div = document.createElement('div');
ReactDOM.render(<App />, div);
});
FAIL src/App.test.js
● Test suite failed to run
/Users/vesa/code/muut/create-react-app/packages/react-scripts/template/src/App.test.js:6
const fn = ({ a, ...otherProps }) => otherProps;
^^^
SyntaxError: Unexpected token ...
at transformAndBuildScript (../node_modules/jest/node_modules/jest-cli/node_modules/jest-runtime/build/transform.js:284:10)
at process._tickCallback (../../../internal/process/next_tick.js:103:7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment