Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
chore(deps-dev): bump prettier from 1.18.2 to 1.19.1 (#368)
Browse files Browse the repository at this point in the history
* chore(deps-dev): bump prettier from 1.18.2 to 1.19.1

Bumps [prettier](https://github.com/prettier/prettier) from 1.18.2 to 1.19.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](prettier/prettier@1.18.2...1.19.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore: re-running prettier

* chore: re-running prettier
  • Loading branch information
dependabot-preview[bot] authored and erunion committed Nov 14, 2019
1 parent cd7dba3 commit ac5a385
Show file tree
Hide file tree
Showing 9 changed files with 816 additions and 98 deletions.
7 changes: 6 additions & 1 deletion packages/api-explorer/__tests__/lib/get-auth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ it('should not error if oas.components is not set', () => {
const { getSingle } = getAuth;

const topLevelUser = { apiKey: '123456', user: 'user', pass: 'pass' };
const keysUser = { keys: [{ apiKey: '123456', name: 'app-1' }, { apiKey: '7890', name: 'app-2' }] };
const keysUser = {
keys: [
{ apiKey: '123456', name: 'app-1' },
{ apiKey: '7890', name: 'app-2' },
],
};
const topLevelSchemeUser = { schemeName: 'scheme-key' };
const keysSchemeUser = {
keys: [
Expand Down
134 changes: 73 additions & 61 deletions packages/api-explorer/__tests__/lib/parse-response.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,22 @@ test('should pass through URL with proxy removed', async () => {

test('should pass through URL with query string', async () => {
expect(
(await parseResponse(
createHar({
method,
url,
headers: [],
queryString: [
{
name: 'a',
value: '123456',
},
],
}),
response,
)).url,
(
await parseResponse(
createHar({
method,
url,
headers: [],
queryString: [
{
name: 'a',
value: '123456',
},
],
}),
response,
)
).url,
).toBe('http://petstore.swagger.io/v2/pet?a=123456');
});

Expand All @@ -71,62 +73,70 @@ test('should pass through method', async () => {

test('should return array for request headers', async () => {
expect(
(await parseResponse(
createHar({
headers: [
{
name: 'Authorization',
value: 'Bearer api-key',
},
{
name: 'Authorization1',
value: 'Bearer api-key1',
},
],
url,
}),
response,
)).requestHeaders,
(
await parseResponse(
createHar({
headers: [
{
name: 'Authorization',
value: 'Bearer api-key',
},
{
name: 'Authorization1',
value: 'Bearer api-key1',
},
],
url,
}),
response,
)
).requestHeaders,
).toEqual(['Authorization: Bearer api-key', 'Authorization1: Bearer api-key1']);
});

test('should return with post data if set', async () => {
expect(
(await parseResponse(
createHar({
headers: [],
postData: {
text: JSON.stringify({ a: 1 }),
},
url,
}),
response,
)).requestBody,
(
await parseResponse(
createHar({
headers: [],
postData: {
text: JSON.stringify({ a: 1 }),
},
url,
}),
response,
)
).requestBody,
).toEqual(JSON.stringify({ a: 1 }));
});

test('should return with null if postData is empty object', async () => {
expect(
(await parseResponse(
createHar({
headers: [],
postData: {},
url,
}),
response,
)).requestBody,
(
await parseResponse(
createHar({
headers: [],
postData: {},
url,
}),
response,
)
).requestBody,
).toEqual(null);
});

test('should return with null if postData is undefined', async () => {
expect(
(await parseResponse(
createHar({
headers: [],
url,
}),
response,
)).requestBody,
(
await parseResponse(
createHar({
headers: [],
url,
}),
response,
)
).requestBody,
).toEqual(null);
});

Expand All @@ -147,12 +157,14 @@ test('should return null for `type` if content-type header missing', async () =>

test('should remove x-final-url header set by the proxy', async () => {
expect(
(await parseResponse(
har,
new Response('', {
headers: { 'x-final-url': 'http://example.com' },
}),
)).responseHeaders,
(
await parseResponse(
har,
new Response('', {
headers: { 'x-final-url': 'http://example.com' },
}),
)
).responseHeaders,
).toEqual([]);
});

Expand Down
Loading

0 comments on commit ac5a385

Please sign in to comment.