1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/examples
Nick Gauthier bbbf7ab498 Upgrade with-jest-typescript example to next 6.0.0 (#4543)
Hello! I ran into an issue using typescript and jest with next 6.0.0. I was able to work through fixing it and I wanted to share my solution back to next.js, by upgrading the with-jest-typescript example to next 6.0.0.

The steps I followed were:

1. `npx babel-upgrade --write` which added babel-core@^7.0.0-bridge.0 to allow jest's babel 6 to play nice with next's babel 7
2. Remove `ts-jest` and replace with `babel-jest` to use babel to transform the typescript code, as is done when the dev and production builds run
3. Update the babelrc to use commonjs modules in test mode to be compatible with jest

Also, I removed the `NODE_ENV=test` on the jest task, because jest sets the env to test anyways, and I'm on windows where this code is incorrect. The other option is to use `cross-env` but I felt it was simpler to just remove the environment override.

To my knowledge, this PR would help on the following issues:

#3663 #4227 #4531 #4528 #4239
2018-06-06 10:31:21 +02:00
..
active-class-name Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
basic-css Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
basic-export Add basic export example 2018-05-01 19:06:06 -07:00
custom-charset Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
custom-server Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
custom-server-actionhero Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
custom-server-express Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
custom-server-fastify Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
custom-server-hapi Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
custom-server-koa Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
custom-server-micro Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
custom-server-nodemon Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
custom-server-polka Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
custom-server-typescript Update typescript examples to use 1.0.1 of next-typescript (#4472) 2018-05-25 11:28:35 +02:00
data-fetch Fix class name in data-fetch example (#4358) 2018-05-13 18:12:03 +02:00
form-handler Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
gh-pages Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
head-elements Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
hello-world Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
layout-component Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
nested-components Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
only-client-render-external-dependencies Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
page-transitions Remove page-transitions example 2018-05-25 14:19:40 +02:00
parameterized-routing Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
pass-server-data Update pass-server-data example [ci skip] (#4362) 2018-05-14 00:00:03 +02:00
progressive-render Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
root-static-files Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
shared-modules Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
ssr-caching Update ssr-caching example (#4363) 2018-05-14 00:00:37 +02:00
svg-components Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
using-inferno Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
using-nerv Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
using-preact fix(examples/using-preact): use latest next-preact (#4152) 2018-04-14 07:49:06 +02:00
using-router Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
using-with-router Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-absolute-imports Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-algolia-react-instantsearch Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-amp Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-ant-design Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-antd-mobile Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-aphrodite Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-apollo Remove unused import (patch) (#4493) 2018-05-29 19:33:21 +02:00
with-apollo-and-redux Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-apollo-and-redux-saga Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-apollo-auth Fixed error with the cookie parser in with-apollo-auth (#4445) 2018-05-21 21:51:00 +02:00
with-app-layout Add _app layout example 2018-04-24 12:31:26 -07:00
with-asset-imports Update with-asset-imports [ci skip] (#4365) 2018-05-14 00:29:39 +02:00
with-babel-macros Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-cerebral Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-componentdidcatch Fix and improve example : with-componentdidcatch (#4400) 2018-05-18 10:51:11 +02:00
with-configured-preset-env Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-custom-babel-config Fix example with-custom-babel-config: update to Babel 7 (#4349) 2018-05-13 00:47:56 +02:00
with-custom-reverse-proxy Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-cxs Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-data-prefetch Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-docker Update package.json in with-docker example (#4359) 2018-05-13 18:10:00 +02:00
with-dotenv Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-draft-js Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-dynamic-import Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-electron Update with-electron example (#4386) 2018-05-16 10:49:13 +02:00
with-emotion Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-emotion-fiber Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-external-scoped-css Deprecate css examples 2018-01-31 11:19:34 +01:00
with-fela Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-firebase-authentication Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-firebase-hosting with-firebase-hosting: update to work with next v6 (#4435) 2018-05-21 10:28:09 +02:00
with-firebase-hosting-and-typescript Update typescript examples to use 1.0.1 of next-typescript (#4472) 2018-05-25 11:28:35 +02:00
with-flow Add eslint parser to avoid errors in IDE. (#4297) 2018-05-07 21:11:14 +02:00
with-freactal Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-glamor Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-glamorous Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-global-stylesheet Update babel-plugin-module-resolver version in with-global-stylesheet (#4360) 2018-05-13 18:09:25 +02:00
with-global-stylesheet-simple Update README in with-global-stylesheet-simple [ci skip] (#4361) 2018-05-13 18:08:44 +02:00
with-google-analytics Add with-google-analytics example (#4036) 2018-03-29 17:03:28 +02:00
with-hashed-statics Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-higher-order-component Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-i18next Fix "with-i18next" example (#4393) 2018-05-16 12:10:01 +02:00
with-immutable-redux-wrapper Add Example of Redux Wrapper with Immutable.js (#4327) 2018-05-10 19:40:21 +02:00
with-ioc Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-jest Fix with-jest example (#4278) 2018-05-05 05:36:59 -07:00
with-jest-typescript Upgrade with-jest-typescript example to next 6.0.0 (#4543) 2018-06-06 10:31:21 +02:00
with-kea Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-loading Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-markdown Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-material-ui 📝️Restructure with-material-ui per #4439 (#4444) 2018-05-21 22:14:31 +02:00
with-mobx Fix with-mobx example (#4394) 2018-05-16 10:20:13 +02:00
with-mobx-state-tree Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-next-css Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-next-less Add with-next-less example (#4492) 2018-05-29 10:37:03 +02:00
with-next-page-transitions Add example with next-page-transitions (#4404) 2018-05-17 12:47:19 +02:00
with-next-routes Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-next-sass Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-noscript Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-now-env Prevent now-env from running in production (#4259) 2018-05-04 22:14:59 -07:00
with-pkg fix(with-pkg): update pkg config for next.js (#4307) 2018-05-08 11:52:52 +02:00
with-polyfills Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-portals Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-prefetching Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-pretty-url-routing Add license section in with-pretty-url-routing [ci skip] (#4366) 2018-05-14 01:40:08 +02:00
with-react-ga Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-react-helmet Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-react-i18next [with-react-i18next] Fix flickering on page change via <Link /> (#4318) 2018-05-09 15:06:37 +02:00
with-react-intl fixes bug in with-react-intl example: messages and locale variables were undefined on CSR (#4517) 2018-06-01 23:16:11 +02:00
with-react-md Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-react-native-web added support flex: 1 and and tag support Dimensions (#4460) 2018-05-23 22:47:16 +02:00
with-react-toolbox Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-react-uwp Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-react-with-styles Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-reasonml with-reasonml: better setup (#4218) 2018-04-27 08:24:46 -07:00
with-rebass Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-recompose Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-redux Improve with-redux example (#4377) 2018-05-15 09:49:07 +02:00
with-redux-code-splitting Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-redux-observable Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-redux-reselect-recompose Merge branch 'canary' 2018-04-29 11:43:37 -07:00
with-redux-saga Improve with-redux-saga example (#4392) 2018-05-16 10:47:12 +02:00
with-redux-wrapper Support _app approach for upgraded Redux Wrapper (#4207) 2018-05-08 14:57:41 +02:00
with-reflux Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-refnux Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-relay-modern Relay modern example fixes (#4120) 2018-04-07 12:41:26 +02:00
with-rematch Added example for usage with rematch (#4095) 2018-04-18 14:03:24 +02:00
with-scoped-stylesheets-and-postcss Deprecate css examples 2018-01-31 11:19:34 +01:00
with-segment-analytics Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-semantic-ui Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-sentry Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-shallow-routing Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-sitemap-and-robots-express-server sitemap.xml and robots.txt example (#4163) 2018-05-25 14:01:32 +02:00
with-socket.io Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-static-export Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-styled-components Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-styled-jsx-plugins Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-styled-jsx-postcss Make styled-jsx configurable (#3050) 2017-10-15 19:54:57 +02:00
with-styled-jsx-scss Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-styletron Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-sw-precache Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-tailwindcss Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-typescript Update typescript examples to use 1.0.1 of next-typescript (#4472) 2018-05-25 11:28:35 +02:00
with-universal-configuration Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-universal-configuration-runtime Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-url-object-routing Update with-url-object-routing (#4314) 2018-05-16 12:35:27 +02:00
with-videojs added example of integration with videojs (#4139) 2018-04-12 12:22:37 +02:00
with-webpack-bundle-analyzer Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-webpack-bundle-size-analyzer Examples: stabalise README format and create-next-app usage (#4009) 2018-04-03 14:19:05 +02:00
with-zones fix README typo (#4476) 2018-05-26 12:11:09 +02:00
.babelrc Add componentDidCatch example 2018-04-23 14:22:36 -07:00
.gitignore Remove yarn.lock from examples (#912) 2017-01-29 05:48:53 +05:30