Skip to content

Commit

Permalink
fix(expo): update flaky expo tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ndcunningham committed Dec 12, 2024
1 parent e944c47 commit a807d81
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions e2e/expo/src/expo-legacy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('@nx/expo (legacy)', () => {

it('should serve with metro', async () => {
let process: ChildProcess;
const port = 8081;
const port = 8051;

try {
process = await runCommandUntil(
Expand Down Expand Up @@ -168,16 +168,17 @@ describe('@nx/expo (legacy)', () => {
});

it('should start', async () => {
const port = 8041;
// run start command
const startProcess = await runCommandUntil(
`start ${appName} -- --port=8081`,
(output) => output.includes(`http://localhost:8081`)
`start ${appName} -- --port=${port}`,
(output) => output.includes(`http://localhost:${port}`)
);

// port and process cleanup
try {
await promisifiedTreeKill(startProcess.pid, 'SIGKILL');
await killPorts(8081);
await killPorts(port);
} catch (err) {
expect(err).toBeFalsy();
}
Expand Down
8 changes: 4 additions & 4 deletions e2e/expo/src/expo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ describe('@nx/expo', () => {

it('should start the app', async () => {
let process: ChildProcess;
const port = 8081;
const port = 8088;

try {
process = await runCommandUntil(
`start ${appName} -- --port=${port}`,
(output) => output.includes(`http://localhost:8081`)
(output) => output.includes(`http://localhost:8088`)
);
} catch (err) {
console.error(err);
Expand All @@ -74,12 +74,12 @@ describe('@nx/expo', () => {

it('should serve the app', async () => {
let process: ChildProcess;
const port = 8081;
const port = 8071;

try {
process = await runCommandUntil(
`serve ${appName} -- --port=${port}`,
(output) => output.includes(`http://localhost:8081`)
(output) => output.includes(`http://localhost:8071`)
);
} catch (err) {
console.error(err);
Expand Down

0 comments on commit a807d81

Please sign in to comment.