Skip to content

Commit

Permalink
github actions update and eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
vanGalilea committed Jan 31, 2024
1 parent 13d0841 commit 333ab66
Show file tree
Hide file tree
Showing 15 changed files with 341 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: yarn install

- name: Build Release APK
run: cd android && ./gradlew assembleRelease
run: cd apps/rn-cli-app/android/ && ./gradlew assembleRelease

- name: Upload to Maestro Cloud
uses: mobile-dev-inc/[email protected]
Expand Down
4 changes: 4 additions & 0 deletions apps/rn-expo-app/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

/.expo

node_modules
7 changes: 7 additions & 0 deletions apps/rn-expo-app/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
root: true,
extends: ['universe/native'],

Check warning on line 3 in apps/rn-expo-app/.eslintrc.js

View workflow job for this annotation

GitHub Actions / install-lint-test-scan

Replace `'universe/native'` with `"universe/native"`
env: {
node: true,
},
};
2 changes: 1 addition & 1 deletion apps/rn-expo-app/__tests__/app/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { renderRouter, userEvent, screen } from "expo-router/testing-library";
import {renderRouter, userEvent, screen} from 'expo-router/testing-library';

Check warning on line 1 in apps/rn-expo-app/__tests__/app/index.test.tsx

View workflow job for this annotation

GitHub Actions / install-lint-test-scan

Replace `renderRouter,·userEvent,·screen}·from·'expo-router/testing-library'` with `·renderRouter,·userEvent,·screen·}·from·"expo-router/testing-library"`

jest.useFakeTimers();

Expand Down
10 changes: 5 additions & 5 deletions apps/rn-expo-app/app/blogs/[slug].tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Text } from 'react-native';
import { useLocalSearchParams } from "expo-router";
import {useLocalSearchParams} from 'expo-router';
import {Text} from 'react-native';

export default function Page() {
const { slug } = useLocalSearchParams();

return <Text>Blog post: {slug}</Text>;}
const {slug} = useLocalSearchParams();

return <Text>Blog post: {slug}</Text>;
}
2 changes: 1 addition & 1 deletion apps/rn-expo-app/app/blogs/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Text} from 'react-native';
import {Link} from 'expo-router';
import {Text} from 'react-native';

export default function Page() {
return (
Expand Down
3 changes: 1 addition & 2 deletions apps/rn-expo-app/app/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Pressable, Text } from "react-native";
import { Link } from "expo-router";
import {Text} from 'react-native';

export default function Page() {
return (
Expand Down
9 changes: 6 additions & 3 deletions apps/rn-expo-app/app/settings/country.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Text } from 'react-native';
import {Text} from 'react-native';

export default function Page() {
return <><Text >Country page!</Text></>;
return (
<>
<Text>Country page!</Text>
</>
);
}

16 changes: 9 additions & 7 deletions apps/rn-expo-app/app/settings/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { Text } from 'react-native';
import { Link } from "expo-router";
import {Link} from 'expo-router';
import {Text} from 'react-native';

export default function Page() {
return <>
<Text>Settings page!</Text>
<Link href="/settings/country/">Country</Link>
</>}

return (
<>
<Text>Settings page!</Text>
<Link href="/settings/country/">Country</Link>
</>
);
}
2 changes: 1 addition & 1 deletion apps/rn-expo-app/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo']
presets: ['babel-preset-expo'],
};
};
1 change: 0 additions & 1 deletion apps/rn-expo-app/jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
import '@testing-library/react-native/extend-expect';

2 changes: 1 addition & 1 deletion apps/rn-expo-app/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { getDefaultConfig } = require('expo/metro-config');
const {getDefaultConfig} = require('expo/metro-config');
const path = require('path');

// Find the project and workspace directories
Expand Down
12 changes: 9 additions & 3 deletions apps/rn-expo-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web",
"test": "jest",
"ts:check": "tsc"
"test:unit": "jest",
"test:unit:coverage": "jest --coverage",
"ts:check": "tsc",
"lint": "eslint ."
},
"dependencies": {
"@expo/config": "^8.5.4",
Expand All @@ -29,13 +31,17 @@
"@testing-library/react-native": "^12.4.3",
"@types/jest": "^29.5.11",
"@types/react": "~18.2.45",
"eslint": "^8.56.0",
"eslint-config-universe": "^12.0.0",
"jest": "^29.7.0",
"jest-expo": "~50.0.1",
"prettier": "^3.2.4",
"react-test-renderer": "^18.2.0",
"typescript": "^5.1.3"
},
"private": true,
"installConfig": {
"hoistingLimits": "workspaces"
}
},
"license": "MIT"
}
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@
],
"repository": "https://github.com/vanGalilea/react-native-testing.git",
"author": "vanGalilea <[email protected]>",
"license": "MIT"
"license": "MIT",
"scripts": {
"test:unit": "yarn workspaces run test:unit:coverage",
"lint": "yarn workspaces run lint"
}
}
Loading

0 comments on commit 333ab66

Please sign in to comment.