Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ninadbstack committed Oct 23, 2024
1 parent dd158bc commit f6d447d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
6 changes: 4 additions & 2 deletions packages/cli-build/test/id.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ describe('percy build:id', () => {

expect(logger.stderr).toEqual([]);
expect(logger.stdout).toEqual(['123']);
expect(percyServer.requests).toEqual([['/percy/healthcheck']]);
expect(percyServer.requests.length).toEqual(1);
expect(percyServer.requests[0][0]).toEqual('/percy/healthcheck');
});

it('can call the /percy/healthcheck endpoint at an alternate port', async () => {
Expand All @@ -40,7 +41,8 @@ describe('percy build:id', () => {

expect(logger.stderr).toEqual([]);
expect(logger.stdout).toEqual(['456']);
expect(percyServer.requests).toEqual([['/percy/healthcheck']]);
expect(percyServer.requests.length).toEqual(1);
expect(percyServer.requests[0][0]).toEqual('/percy/healthcheck');
});

it('logs an error when the endpoint errors', async () => {
Expand Down
6 changes: 4 additions & 2 deletions packages/cli-exec/test/ping.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ describe('percy exec:ping', () => {

expect(logger.stderr).toEqual([]);
expect(logger.stdout).toEqual(['[percy] Percy is running']);
expect(percyServer.requests).toEqual([['/percy/healthcheck']]);
expect(percyServer.requests.length).toEqual(1);
expect(percyServer.requests[0][0]).toEqual('/percy/healthcheck');
});

it('can ping /percy/healthcheck at an alternate port', async () => {
Expand All @@ -46,7 +47,8 @@ describe('percy exec:ping', () => {

expect(logger.stderr).toEqual([]);
expect(logger.stdout).toEqual(['[percy] Percy is running']);
expect(percyServer.requests).toEqual([['/percy/healthcheck']]);
expect(percyServer.requests.length).toEqual(1);
expect(percyServer.requests[0][0]).toEqual('/percy/healthcheck');
});

it('logs an error when the endpoint errors', async () => {
Expand Down
14 changes: 6 additions & 8 deletions packages/cli-exec/test/stop.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ describe('percy exec:stop', () => {

await stop();

expect(percyServer.requests).toEqual([
['/percy/stop'],
['/percy/healthcheck']
]);
expect(percyServer.requests.length).toEqual(2);
expect(percyServer.requests[0][0]).toEqual('/percy/stop');
expect(percyServer.requests[1][0]).toEqual('/percy/healthcheck');

expect(logger.stderr).toEqual([]);
expect(logger.stdout).toEqual(['[percy] Percy has stopped']);
Expand All @@ -54,10 +53,9 @@ describe('percy exec:stop', () => {

await stop(['--port=4567']);

expect(percyServer.requests).toEqual([
['/percy/stop'],
['/percy/healthcheck']
]);
expect(percyServer.requests.length).toEqual(2);
expect(percyServer.requests[0][0]).toEqual('/percy/stop');
expect(percyServer.requests[1][0]).toEqual('/percy/healthcheck');

expect(logger.stderr).toEqual([]);
expect(logger.stdout).toEqual(['[percy] Percy has stopped']);
Expand Down

0 comments on commit f6d447d

Please sign in to comment.