Skip to content

Commit

Permalink
updating tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zbenamram committed Aug 14, 2024
1 parent 9c37cb7 commit 1cdb0ca
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion test/e2e/proxy-axios.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ describe('proxy axios functionality', () => {
},
SUPERGOOD_SERVER
);
// NOTE: currently implementation does not update the protocol
// between upstream and proxy
// TODO: support protocol differences between upstream + proxy
await axios.get(`http://api.openai.com/custom-header`);
await Supergood.close();
expect(getEvents(postEventsMock).length).toEqual(1);
expect(getEvents(postEventsMock)[0].request.url).toEqual(
'https://api.openai.com/custom-header'
'http://api.openai.com/custom-header'
);
expect(getEvents(postEventsMock)[0].response.status).toEqual(200);
expect(
Expand Down
7 changes: 5 additions & 2 deletions test/e2e/proxy-native-fetch.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ describe('proxy native fetch functionality', () => {
},
SUPERGOOD_SERVER
);
await fetch(`https://api.openai.com/custom-header`);
// NOTE: currently implementation does not update the protocol
// between upstream and proxy
// TODO: support protocol differences between upstream + proxy
await fetch(`http://api.openai.com/custom-header`);
await Supergood.close();
expect(getEvents(postEventsMock).length).toEqual(1);
expect(getEvents(postEventsMock)[0].request.url).toEqual(
'https://api.openai.com/custom-header'
'http://api.openai.com/custom-header'
);
expect(getEvents(postEventsMock)[0].response.status).toEqual(200);
expect(
Expand Down
5 changes: 4 additions & 1 deletion test/e2e/proxy-node-fetch.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ describe('proxy node-fetch functionality', () => {
},
SUPERGOOD_SERVER
);
// NOTE: currently implementation does not update the protocol
// between upstream and proxy
// TODO: support protocol differences between upstream + proxy
await fetch(`http://api.openai.com/custom-header`);
await Supergood.close();
expect(getEvents(postEventsMock).length).toEqual(1);
expect(getEvents(postEventsMock)[0].request.url).toEqual(
'https://api.openai.com/custom-header'
'http://api.openai.com/custom-header'
);
expect(getEvents(postEventsMock)[0].response.status).toEqual(200);
expect(
Expand Down

0 comments on commit 1cdb0ca

Please sign in to comment.