Skip to content

Commit 6c6316e

Browse files
authored
fix silent failing test (#1690)
1 parent 7d33cd1 commit 6c6316e

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

packages/cli/tests/watch.test.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ describe('should determine the correct port', () => {
8989
expect(await determinePort('3999')).toBe(3999);
9090
});
9191

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

107107
it('should return an error if requested --port is taken', async () => {
108-
await Promise.all([determinePort(4003), determinePort(4003)]).catch(
109-
error => {
110-
expect(error.message).toMatch(
111-
new RegExp(
112-
/^Another process is already running on port 4003. Please choose a different port./g
113-
)
114-
);
115-
}
108+
expect(
109+
Promise.all([determinePort(4003), determinePort(4003)])
110+
).rejects.toThrow(
111+
'Another process is already running on port 4003. Please choose a different port.'
116112
);
117113
});
118114

0 commit comments

Comments
 (0)