feat(detox): upgrade @config-plugins/detox to 7 (#21959)

This commit is contained in:
Emily Xiong 2024-02-29 13:59:32 -05:00 committed by GitHub
parent 729e0a15ce
commit e687aad0e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 45 additions and 12 deletions

View File

@ -14,7 +14,7 @@
"port": {
"type": "number",
"description": "Port to start the native Metro bundler on (does not apply to web or tunnel)",
"default": 19000,
"default": 4200,
"alias": "p"
},
"clear": {

View File

@ -108,6 +108,23 @@
"alwaysAddToPackageJson": false
}
}
},
"18.1.0": {
"version": "18.1.0-beta.0",
"packages": {
"detox": {
"version": "~20.18.1",
"alwaysAddToPackageJson": false
},
"@config-plugins/detox": {
"version": "~7.0.0",
"alwaysAddToPackageJson": false
},
"@testing-library/jest-dom": {
"version": "~6.4.2",
"alwaysAddToPackageJson": false
}
}
}
}
}

View File

@ -1 +1,5 @@
export { createNodes, DetoxPluginOptions } from './src/plugins/plugin';
export {
createNodes,
createDependencies,
DetoxPluginOptions,
} from './src/plugins/plugin';

View File

@ -1,5 +1,5 @@
export const nxVersion = require('../../package.json').version;
export const detoxVersion = '^20.16.0';
export const testingLibraryJestDom = '6.2.0';
export const configPluginsDetoxVersion = '~6.0.0'; // only required for expo
export const detoxVersion = '~20.18.1';
export const testingLibraryJestDom = '~6.4.2';
export const configPluginsDetoxVersion = '~7.0.0'; // only required for expo

View File

@ -1 +1,5 @@
export { createNodes, ExpoPluginOptions } from './plugins/plugin';
export {
createNodes,
createDependencies,
ExpoPluginOptions,
} from './plugins/plugin';

View File

@ -11,7 +11,7 @@
"port": {
"type": "number",
"description": "Port to start the native Metro bundler on (does not apply to web or tunnel)",
"default": 19000,
"default": 4200,
"alias": "p"
},
"clear": {

View File

@ -84,7 +84,11 @@ function serveAsync(
childProcess.stdout.on('data', (data) => {
process.stdout.write(data);
if (data.toString().includes('Bundling complete')) {
if (
data
.toString()
.includes('Bundling complete' || data.toString().includes('Bundled'))
) {
resolve(childProcess);
}
});

View File

@ -19,8 +19,8 @@ export async function addE2e(
const port = hasPlugin ? 8081 : 4200;
switch (options.e2eTestRunner) {
case 'cypress': {
const hasNxExportPlugin = hasExpoPlugin(tree);
if (!hasNxExportPlugin) {
const hasNxExpoPlugin = hasExpoPlugin(tree);
if (!hasNxExpoPlugin) {
webStaticServeGenerator(tree, {
buildTarget: `${options.projectName}:export`,
targetName: 'serve-static',
@ -50,7 +50,7 @@ export async function addE2e(
devServerTarget: `${options.projectName}:serve`,
port,
baseUrl: `http://localhost:${port}`,
ciWebServerCommand: hasNxExportPlugin
ciWebServerCommand: hasNxExpoPlugin
? `nx run ${options.projectName}:serve-static`
: undefined,
jsx: true,

View File

@ -1 +1,5 @@
export { createNodes, ReactNativePluginOptions } from './plugins/plugin';
export {
createNodes,
createDependencies,
ReactNativePluginOptions,
} from './plugins/plugin';