1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/test
Kyle Holmberg 72e7929242 Change page export validity check on client and server in development (#5857)
Resolves #4055 

Credit: https://github.com/zeit/next.js/pull/5095

I didn't use the ignore webpack plugin from the original PR and tested bundle size with https://github.com/zeit/next.js/pull/5339 - seems to be safe on that front.

Was able to get tests to pass locally, unsure of what goes wrong in CI 🤷‍♂️ 

**Questions**
1) The initial PR didn't include changes to `next-server/lib/router` in `getRouteInfo()`. Should the same changes be made within?

2) Should we add a test for rendering a component created via `forwardRef()`?

`component-with-forwardedRef`:
```javascript
export default React.forwardRef((props, ref) => <span {...props} forwardedRef={ref}>This is a component with a forwarded ref</span>);
```

some test:
```javascript
test('renders from forwardRef', async () => {
  const $ = await get$('/component-with-forwardedRef')
  const span = $('span')
  expect(span.text()).toMatch(/This is a component with a forwarded ref/)
})
```
2018-12-17 16:09:23 +01:00
..
integration Change page export validity check on client and server in development (#5857) 2018-12-17 16:09:23 +01:00
isolated Move getPageFiles and convert to ts (#5841) 2018-12-07 13:35:01 +01:00
lib add --node-args option (#5858) 2018-12-15 22:55:59 +01:00
unit Use Typescript to transpile Next.js core files instead of Babel (#5747) 2018-11-28 15:03:02 +01:00
.babelrc Use preset-react's development option + enable modules transform in test env (#5081) 2018-09-03 16:41:52 +02:00
.gitignore Universal Webpack (#3578) 2018-01-30 16:44:44 +01:00
jest-global-setup.js Refactor test setup (#5391) 2018-10-12 15:32:17 +02:00
jest-global-teardown.js Refactor test setup (#5391) 2018-10-12 15:32:17 +02:00