rsnext/test
JJ Kasper 89ca0d10d4
Update to use getDataHref in fetchNextData (#14667)
This updates `fetchNextData` to re-use the `getDataHref` function from `page-loader` which has more verbose handling to ensure the correct `/_next/data` URL is built. Re-using this logic ensures the `/_next/data` URL can still be built even when a mismatching `href` and `as` value is provided to `next/link`.

This also fixes a case in `getDataHref` where optional values that weren't provided would fail to build the data href since the check requiring the param be present while interpolating the route values hasn't been updated to allow missing params for optional values.

An additional test case has been added to the prerender suite to ensure the `/_next/data` URL is built correctly when mismatching `href` and `as` values are provided

x-ref: https://github.com/vercel/next.js/discussions/14536
x-ref: https://github.com/vercel/next.js/discussions/9081#discussioncomment-31160
Closes: https://github.com/vercel/next.js/issues/14668
2020-06-29 15:14:45 +00:00
..
.stats-app Remove remaining granular chunks references (#13672) 2020-06-02 14:45:07 +00:00
acceptance Fix Fast Refresh with Page Config (#14041) 2020-06-10 19:56:05 +00:00
eslint-plugin-next bug fixes for css eslint rule (#14202) 2020-06-15 23:42:36 +00:00
integration Update to use getDataHref in fetchNextData (#14667) 2020-06-29 15:14:45 +00:00
isolated Fix pages/index.js and pages/index/index.js behavior (#13699) 2020-06-04 17:32:45 +00:00
lib Remove buildId from server-side files (#14413) 2020-06-22 21:12:36 +00:00
unit Handle rendering next/head outside of Next.js (#14511) 2020-06-23 20:46:40 +00: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-environment.js Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
jest-global-setup.js Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
jest-global-teardown.js Update CI/test set up (#9499) 2019-11-25 13:19:45 -05:00
jest-setup-after-env.js Only retry tests on CI (#12998) 2020-05-17 12:10:02 -04:00
test-file.txt Add additional file serving tests (#12479) 2020-05-04 11:58:19 -05:00
tsconfig.json Update tsconfig for tests 2020-01-21 15:29:39 -06:00