Skip to content

Commit

Permalink
fix silent failing test (#1690)
Browse files Browse the repository at this point in the history
  • Loading branch information
zubhav committed May 5, 2022
1 parent 7d33cd1 commit 6c6316e
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions packages/cli/tests/watch.test.js
Expand Up @@ -89,7 +89,7 @@ describe('should determine the correct port', () => {
expect(await determinePort('3999')).toBe(3999);
});

it('should use $PORT in the abscence of --port', async () => {
it('should use $PORT in the absence of --port', async () => {
process.env.PORT = '4001';
expect(await determinePort()).toBe(4001);
});
Expand All @@ -105,14 +105,10 @@ describe('should determine the correct port', () => {
});

it('should return an error if requested --port is taken', async () => {
await Promise.all([determinePort(4003), determinePort(4003)]).catch(
error => {
expect(error.message).toMatch(
new RegExp(
/^Another process is already running on port 4003. Please choose a different port./g
)
);
}
expect(
Promise.all([determinePort(4003), determinePort(4003)])
).rejects.toThrow(
'Another process is already running on port 4003. Please choose a different port.'
);
});

Expand Down

0 comments on commit 6c6316e

Please sign in to comment.