Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: silently failing test in watch.test.js #1690

Merged
merged 1 commit into from May 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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