-
Notifications
You must be signed in to change notification settings - Fork 139
Conversation
boilerplate/package.json.ejs
Outdated
"preset": "jest-preset-ignite" | ||
"preset": "jest-preset-ignite", | ||
"testPathIgnorePatterns": [ | ||
"/e2e/", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is only necessary if using Detox (Bowser does not) and the Detox tests are located in the e2e
folder, which I'm not certain is the default, so I would probably suggest removing this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, will remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kevinvangelder removed this line in package.json. Final verion
"jest": {
"preset": "jest-preset-ignite",
"testPathIgnorePatterns": [
"/node_modules"
],
"globals": {
"__TEST__": true
}
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -12,6 +12,11 @@ const StorybookUI = getStorybookUI({ port: 9001, host: "localhost", onDeviceUI: | |||
export class StorybookUIRoot extends React.Component { | |||
componentDidMount() { | |||
SplashScreen.hide() | |||
if (typeof __TEST__ === "undefined" || !__TEST__) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined
is falsy, so you could use !__TEST__
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You would think that, but it was causing explosions, hence this solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. So leaving this as if (typeof __TEST__ === "undefined" || !__TEST__)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be fair, it was exploding prior to declaring TEST in setup.ts, but I'm pretty sure I tested removing this after that and still faced issues.
New Trello Board link: https://trello.com/c/YPZKngqg/28-configure-reactotron-in-storybook
Closes #81
Implements add-reactotron-to-storybook based on Kevin's suggestion in #81
Reactotron now executes when running storybook tests. It shuts off as expected when running
yarn test
.This PR fixes this test warning:
"console.warn node_modules/react-native/jest/setup.js:91
Calling .blur() in the test renderer environment is not supported. Instead, mock out your components that use findNodeHandle with replacements that don't rely on the native environment."
by adding a new mock for text-input "mock-textinput.ts" that sets the "autoFocus" prop to false when tests are running.
Fixed a bunch of rendering issues with Storybook tests.
(1) The default color of the Text component is white, which is not visible in the storybook tests.
(2) missing en_US translations for the text-field.story.
What follows is screenshots for all fixed Storybook renderings: