Skip to content

Commit

Permalink
test: cleanup snapshot tests (#15082)
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice committed Apr 12, 2022
1 parent e5f90a1 commit 443bef5
Show file tree
Hide file tree
Showing 112 changed files with 870 additions and 35,088 deletions.
120 changes: 0 additions & 120 deletions lib/config/presets/bitbucket-server/__snapshots__/index.spec.ts.snap

This file was deleted.

7 changes: 0 additions & 7 deletions lib/config/presets/bitbucket-server/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ describe('config/presets/bitbucket-server/index', () => {
bitbucketApiHost
);
expect(res).toEqual({ from: 'api' });
expect(httpMock.getTrace()).toMatchSnapshot();
});

it('handles branches/tags', async () => {
Expand All @@ -53,7 +52,6 @@ describe('config/presets/bitbucket-server/index', () => {
'feature/branch'
);
expect(res).toEqual({ from: 'api' });
expect(httpMock.getTrace()).toMatchSnapshot();
});

it('throws 404', async () => {
Expand All @@ -70,7 +68,6 @@ describe('config/presets/bitbucket-server/index', () => {
bitbucketApiHost
)
).rejects.toThrow(PRESET_DEP_NOT_FOUND);
expect(httpMock.getTrace()).toMatchSnapshot();
});

it('throws to big', async () => {
Expand All @@ -91,7 +88,6 @@ describe('config/presets/bitbucket-server/index', () => {
bitbucketApiHost
)
).rejects.toThrow(PRESET_INVALID_JSON);
expect(httpMock.getTrace()).toMatchSnapshot();
});

it('throws to invalid', async () => {
Expand All @@ -111,7 +107,6 @@ describe('config/presets/bitbucket-server/index', () => {
bitbucketApiHost
)
).rejects.toThrow(PRESET_INVALID_JSON);
expect(httpMock.getTrace()).toMatchSnapshot();
});
});

Expand All @@ -133,7 +128,6 @@ describe('config/presets/bitbucket-server/index', () => {
'https://api.github.example.org'
)
).toEqual({ from: 'api' });
expect(httpMock.getTrace()).toMatchSnapshot();
});
it('uses custom path', async () => {
httpMock
Expand All @@ -152,7 +146,6 @@ describe('config/presets/bitbucket-server/index', () => {
'https://api.github.example.org'
)
).toEqual({ from: 'api' });
expect(httpMock.getTrace()).toMatchSnapshot();
});
});
});
43 changes: 0 additions & 43 deletions lib/config/presets/bitbucket/__snapshots__/index.spec.ts.snap

This file was deleted.

3 changes: 0 additions & 3 deletions lib/config/presets/bitbucket/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ describe('config/presets/bitbucket/index', () => {
'some-filename.json'
);
expect(res).toEqual(data);
expect(httpMock.getTrace()).toMatchSnapshot();
});

it('throws on error', async () => {
httpMock.scope(baseUrl).get(`${basePath}/some-filename.json`).reply(404);
await expect(
bitbucket.fetchJSONFile('some/repo', 'some-filename.json')
).rejects.toThrow(PRESET_DEP_NOT_FOUND);
expect(httpMock.getTrace()).toMatchSnapshot();
});

it('throws on invalid json', async () => {
Expand All @@ -45,7 +43,6 @@ describe('config/presets/bitbucket/index', () => {
await expect(
bitbucket.fetchJSONFile('some/repo', 'some-filename.json')
).rejects.toThrow(PRESET_INVALID_JSON);
expect(httpMock.getTrace()).toMatchSnapshot();
});
});

Expand Down

0 comments on commit 443bef5

Please sign in to comment.