mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 18:13:25 +00:00
feat: actually link expo and nx
This commit is contained in:
11
apps/mobile-e2e/.babelrc
Normal file
11
apps/mobile-e2e/.babelrc
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"presets": [
|
||||
[
|
||||
"@nx/react/babel",
|
||||
{
|
||||
"runtime": "automatic",
|
||||
},
|
||||
],
|
||||
],
|
||||
"plugins": [],
|
||||
}
|
89
apps/mobile-e2e/.detoxrc.json
Normal file
89
apps/mobile-e2e/.detoxrc.json
Normal file
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"testRunner": {
|
||||
"args": {
|
||||
"$0": "jest",
|
||||
"config": "./jest.config.json"
|
||||
},
|
||||
"jest": {
|
||||
"setupTimeout": 120000
|
||||
}
|
||||
},
|
||||
"apps": {
|
||||
"ios.debug": {
|
||||
"type": "ios.app",
|
||||
"build": "cd ../../apps/mobile/ios && xcodebuild -workspace Mobile.xcworkspace -scheme Mobile -configuration Debug -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14' -derivedDataPath ./build -quiet",
|
||||
"binaryPath": "../../apps/mobile/ios/build/Build/Products/Debug-iphonesimulator/Mobile.app"
|
||||
},
|
||||
"ios.release": {
|
||||
"type": "ios.app",
|
||||
"build": "cd ../../apps/mobile/ios && xcodebuild -workspace Mobile.xcworkspace -scheme Mobile -configuration Release -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14' -derivedDataPath ./build -quiet",
|
||||
"binaryPath": "../../apps/mobile/ios/build/Build/Products/Release-iphonesimulator/Mobile.app"
|
||||
},
|
||||
|
||||
"ios.local": {
|
||||
"type": "ios.app",
|
||||
"build": "pnpm exec nx run mobile:build --platform ios --profile preview --wait --local --no-interactive --output=../../apps/mobile/dist/Mobile.tar.gz",
|
||||
"binaryPath": "../../apps/mobile/dist/Mobile.app"
|
||||
},
|
||||
|
||||
"android.debug": {
|
||||
"type": "android.apk",
|
||||
"build": "cd ../../apps/mobile/android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug",
|
||||
"binaryPath": "../../apps/mobile/android/app/build/outputs/apk/debug/app-debug.apk"
|
||||
},
|
||||
"android.release": {
|
||||
"type": "android.apk",
|
||||
"build": "cd ../../apps/mobile/android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release",
|
||||
"binaryPath": "../../apps/mobile/android/app/build/outputs/apk/release/app-release.apk"
|
||||
},
|
||||
|
||||
"android.local": {
|
||||
"type": "android.apk",
|
||||
"build": "pnpm exec nx run mobile:build --platform android --profile preview --wait --local --no-interactive --output=../../apps/mobile/dist/Mobile.apk",
|
||||
"binaryPath": "../../apps/mobile/dist/Mobile.apk"
|
||||
}
|
||||
},
|
||||
"devices": {
|
||||
"simulator": {
|
||||
"type": "ios.simulator",
|
||||
"device": {
|
||||
"type": "iPhone 14"
|
||||
}
|
||||
},
|
||||
"emulator": {
|
||||
"type": "android.emulator",
|
||||
"device": {
|
||||
"avdName": "Pixel_4a_API_30"
|
||||
}
|
||||
}
|
||||
},
|
||||
"configurations": {
|
||||
"ios.sim.release": {
|
||||
"device": "simulator",
|
||||
"app": "ios.release"
|
||||
},
|
||||
"ios.sim.debug": {
|
||||
"device": "simulator",
|
||||
"app": "ios.debug"
|
||||
},
|
||||
|
||||
"ios.sim.local": {
|
||||
"device": "simulator",
|
||||
"app": "ios.local"
|
||||
},
|
||||
|
||||
"android.emu.release": {
|
||||
"device": "emulator",
|
||||
"app": "android.release"
|
||||
},
|
||||
"android.emu.debug": {
|
||||
"device": "emulator",
|
||||
"app": "android.debug"
|
||||
},
|
||||
|
||||
"android.emu.local": {
|
||||
"device": "emulator",
|
||||
"app": "android.local"
|
||||
}
|
||||
}
|
||||
}
|
18
apps/mobile-e2e/.eslintrc.json
Normal file
18
apps/mobile-e2e/.eslintrc.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"extends": ["../../.eslintrc.js"],
|
||||
"ignorePatterns": ["!**/*"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": ["*.ts", "*.tsx"],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": ["*.js", "*.jsx"],
|
||||
"rules": {}
|
||||
}
|
||||
]
|
||||
}
|
22
apps/mobile-e2e/jest.config.json
Normal file
22
apps/mobile-e2e/jest.config.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"preset": "../../jest.preset",
|
||||
"rootDir": ".",
|
||||
"testMatch": [
|
||||
"<rootDir>/src/**/*.test.ts?(x)",
|
||||
"<rootDir>/src/**/*.spec.ts?(x)"
|
||||
],
|
||||
"testTimeout": 120000,
|
||||
"maxWorkers": 1,
|
||||
"globalSetup": "detox/runners/jest/globalSetup",
|
||||
"globalTeardown": "detox/runners/jest/globalTeardown",
|
||||
"reporters": ["detox/runners/jest/reporter"],
|
||||
"testEnvironment": "detox/runners/jest/testEnvironment",
|
||||
"verbose": true,
|
||||
"setupFilesAfterEnv": ["<rootDir>/test-setup.ts"],
|
||||
"transform": {
|
||||
"^.+\\.(ts|js|html)$": [
|
||||
"ts-jest",
|
||||
{ "tsconfig": "<rootDir>/tsconfig.e2e.json" }
|
||||
]
|
||||
}
|
||||
}
|
76
apps/mobile-e2e/project.json
Normal file
76
apps/mobile-e2e/project.json
Normal file
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"name": "mobile-e2e",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "apps/mobile-e2e/src",
|
||||
"projectType": "application",
|
||||
"targets": {
|
||||
"build-ios": {
|
||||
"executor": "@nx/detox:build",
|
||||
"options": {
|
||||
"detoxConfiguration": "ios.sim.local"
|
||||
},
|
||||
"configurations": {
|
||||
"bare": {
|
||||
"detoxConfiguration": "ios.sim.debug"
|
||||
},
|
||||
"production": {
|
||||
"detoxConfiguration": "ios.sim.release"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test-ios": {
|
||||
"executor": "@nx/detox:test",
|
||||
"options": {
|
||||
"detoxConfiguration": "ios.sim.local",
|
||||
"buildTarget": "mobile-e2e:build-ios"
|
||||
},
|
||||
"configurations": {
|
||||
"bare": {
|
||||
"detoxConfiguration": "ios.sim.debug",
|
||||
"buildTarget": "mobile-e2e:build-ios:bare"
|
||||
},
|
||||
"production": {
|
||||
"detoxConfiguration": "ios.sim.release",
|
||||
"buildTarget": "mobile-e2e:build-ios:production"
|
||||
}
|
||||
}
|
||||
},
|
||||
"build-android": {
|
||||
"executor": "@nx/detox:build",
|
||||
"options": {
|
||||
"detoxConfiguration": "android.emu.local"
|
||||
},
|
||||
"configurations": {
|
||||
"bare": {
|
||||
"detoxConfiguration": "android.emu.debug"
|
||||
},
|
||||
"production": {
|
||||
"detoxConfiguration": "android.emu.release"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test-android": {
|
||||
"executor": "@nx/detox:test",
|
||||
"options": {
|
||||
"detoxConfiguration": "android.emu.local",
|
||||
"buildTarget": "mobile-e2e:build-android"
|
||||
},
|
||||
"configurations": {
|
||||
"bare": {
|
||||
"detoxConfiguration": "android.emu.debug",
|
||||
"buildTarget": "mobile-e2e:build-android:bare"
|
||||
},
|
||||
"production": {
|
||||
"detoxConfiguration": "android.emu.release",
|
||||
"buildTarget": "mobile-e2e:build-android:production"
|
||||
}
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/eslint:lint",
|
||||
"outputs": ["{options.outputFile}"]
|
||||
}
|
||||
},
|
||||
"tags": [],
|
||||
"implicitDependencies": ["mobile"]
|
||||
}
|
11
apps/mobile-e2e/src/app.spec.ts
Normal file
11
apps/mobile-e2e/src/app.spec.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { device, element, by, expect } from 'detox';
|
||||
|
||||
describe('Mobile', () => {
|
||||
beforeEach(async () => {
|
||||
await device.reloadReactNative();
|
||||
});
|
||||
|
||||
it('should display welcome message', async () => {
|
||||
await expect(element(by.id('heading'))).toHaveText('Welcome Mobile 👋');
|
||||
});
|
||||
});
|
5
apps/mobile-e2e/test-setup.ts
Normal file
5
apps/mobile-e2e/test-setup.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { device } from 'detox';
|
||||
|
||||
beforeAll(async () => {
|
||||
await device.launchApp();
|
||||
});
|
10
apps/mobile-e2e/tsconfig.e2e.json
Normal file
10
apps/mobile-e2e/tsconfig.e2e.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"sourceMap": false,
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"allowJs": true,
|
||||
"types": ["node", "jest", "detox"]
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.js"]
|
||||
}
|
10
apps/mobile-e2e/tsconfig.json
Normal file
10
apps/mobile-e2e/tsconfig.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"files": [],
|
||||
"include": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.e2e.json"
|
||||
}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user