Skip to content

Instantly share code, notes, and snippets.

@markerikson
Last active February 22, 2021 13:00
Show Gist options
  • Save markerikson/5a7ea2d1053c2714d6d709294c970536 to your computer and use it in GitHub Desktop.
Save markerikson/5a7ea2d1053c2714d6d709294c970536 to your computer and use it in GitHub Desktop.
Stuff I googled while updating React-Redux to run tests against React Native
  • Double-checking whether window exists in React Native:
react native window global
  • Finding the giant "useLayoutEffect warnings" thread:
react uselayouteffect ssr
  • General research on how Jest works with React Native:
jest react-dom react-native
jest react-dom react-native react-library
jest react native
  • Figuring out if Jest can load platform-specific files like the bundler does:
jest react native ".native.js"
  • Checking how run different segments of our test suite with different settings:
jest different presets per file
  • Looking to see if any libs test against both RD and RN:
jest "react-dom" "react-native"
  • Trying to figure out the right syntax for the RN Jest preset:
jest Preset react-native is invalid
jest "Preset react-native is invalid"
jest preset react native
  • Trying to solve an error (ultimately caused by lack of transforms applied):
jest mockComponent.js Support for the experimental syntax 'classProperties' isn't currently enabled
  • Wondering if I could create a template string once and reuse it with different values:
es6 template literal delayed interpolation
  • Needed to convert some RD test components to RN, including some that used data-testid:
react native equivalents div li
react-native view dataset
react-native view dataset data attribute
"react native" view dataset data attribute
react-native view testid
  • Figuring out if there's any way to detect use of ReactDOMServer:
react check environment is ssr
react-dom server
reactdomserver environment ssr
  • Shawn Wang joked about renaming Redux Starter Kit to "Redux Advanced Kit Pro With Hooks", so I looked up the classic Microsoft self-parody video on mangling the iPod packaging:
microsoft ipod naming
  • Docs on act():
react async act
  • Wanting to print timestamps in console logging to verify ordering:
jest console output timestamps
  • Looking for a way to shut up the "updates done outside of act()" warning:
jest filter console output
jest mock console
react jest console warning ignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment