[tests] localhost.com -> localhost (#23816)

This commit is contained in:
Jonathan Budzenski 2018-10-30 11:46:50 -05:00 committed by GitHub
parent b80ab1cd83
commit 07c9f1f3be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -18,7 +18,7 @@
*/
jest.mock('../chrome', () => ({
addBasePath: (path: string) => `http://localhost.com/myBase/${path}`,
addBasePath: (path: string) => `http://localhost/myBase/${path}`,
}));
jest.mock('../metadata', () => ({
@ -60,7 +60,7 @@ describe('kfetch', () => {
it('should use supplied pathname and querystring', async () => {
fetchMock.get('*', {});
await kfetch({ pathname: 'my/path', query: { a: 'b' } });
expect(fetchMock.lastUrl('*')).toBe('http://localhost.com/myBase/my/path?a=b');
expect(fetchMock.lastUrl('*')).toBe('http://localhost/myBase/my/path?a=b');
});
it('should use supplied headers', async () => {
@ -87,7 +87,7 @@ describe('kfetch', () => {
it('should prepend url with basepath by default', async () => {
fetchMock.get('*', {});
await kfetch({ pathname: 'my/path' });
expect(fetchMock.lastUrl('*')).toBe('http://localhost.com/myBase/my/path');
expect(fetchMock.lastUrl('*')).toBe('http://localhost/myBase/my/path');
});
it('should not prepend url with basepath when disabled', async () => {
@ -142,7 +142,7 @@ describe('kfetch', () => {
it('should contain response properties', () => {
expect(error.res.status).toBe(404);
expect(error.res.url).toBe('http://localhost.com/myBase/my/path');
expect(error.res.url).toBe('http://localhost/myBase/my/path');
});
});

View file

@ -18,7 +18,7 @@
*/
jest.mock('../chrome', () => ({
addBasePath: (path: string) => `http://localhost.com/myBase/${path}`,
addBasePath: (path: string) => `http://localhost/myBase/${path}`,
}));
jest.mock('../metadata', () => ({