Skip to content

Commit 723c8e2

Browse files
docs: basic cookbook docs and app (#1622)
* docs: basic cookbook docs and app * chore: add tests * chore: enable example apps * chore: fix typecheck * chore: add lint & fix issues * docs: tweaks * docs: tweaks * docs: tweaks * chore: tweaks
1 parent e418b6b commit 723c8e2

28 files changed

+11012
-1
lines changed

.github/workflows/example-apps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
test-example:
1111
strategy:
1212
matrix:
13-
example: [basic]
13+
example: [basic, cookbook]
1414

1515
name: Test Example
1616
runs-on: ubuntu-latest

examples/cookbook/.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test-utils.*

examples/cookbook/.eslintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "@callstack"
3+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true,
3+
"40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true
4+
}

examples/cookbook/.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# General Node.js
2+
node_modules/
3+
.expo/
4+
dist/
5+
npm-debug.*
6+
*.jks
7+
*.p8
8+
*.p12
9+
*.key
10+
*.mobileprovision
11+
*.orig.*
12+
web-build/
13+
14+
# Yarn 4.x
15+
.pnp.*
16+
.yarn/*
17+
!.yarn/patches
18+
!.yarn/plugins
19+
!.yarn/releases
20+
!.yarn/sdks
21+
!.yarn/versions
22+
23+
# macOS
24+
.DS_Store
25+

examples/cookbook/App.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import * as React from 'react';
2+
import { View } from 'react-native';
3+
4+
const App = () => {
5+
return <View />;
6+
};
7+
8+
export default App;

examples/cookbook/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# RNTL Cookbook
2+
3+
This example app gathers recipes from the [RNTL Cookbook](https://callstack.github.io/react-native-testing-library/cookbook).
4+
5+
Each recipe described in the Cookbook should have a corresponding code example in this repo.
6+
7+
Note:
8+
Since examples will showcase usage of different dependencies, the dependencies in `package.json` fill will grow much larger that in an normal React Native. This is fine 🐶☕️🔥.

examples/cookbook/app.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"expo": {
3+
"name": "RNTL Cookbook App",
4+
"slug": "rntl-cookbook",
5+
"version": "1.0.0",
6+
"orientation": "portrait",
7+
"icon": "./assets/icon.png",
8+
"userInterfaceStyle": "light",
9+
"splash": {
10+
"image": "./assets/splash.png",
11+
"resizeMode": "contain",
12+
"backgroundColor": "#ffffff"
13+
},
14+
"updates": {
15+
"fallbackToCacheTimeout": 0
16+
},
17+
"assetBundlePatterns": ["**/*"],
18+
"ios": {
19+
"supportsTablet": true
20+
},
21+
"android": {
22+
"adaptiveIcon": {
23+
"foregroundImage": "./assets/adaptive-icon.png",
24+
"backgroundColor": "#FFFFFF"
25+
}
26+
},
27+
"web": {
28+
"favicon": "./assets/favicon.png"
29+
}
30+
}
31+
}
17.1 KB
Loading

examples/cookbook/assets/favicon.png

1.43 KB
Loading

0 commit comments

Comments
 (0)