Skip to content

Commit

Permalink
tests: test updated
Browse files Browse the repository at this point in the history
  • Loading branch information
rimiti committed Mar 26, 2024
1 parent 698d0d0 commit 27da30f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
9 changes: 0 additions & 9 deletions __tests__/unit/__snapshots__/shifter.ts.snap

This file was deleted.

8 changes: 4 additions & 4 deletions __tests__/unit/shifter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ describe('Shifter', () => {
it('creates a properly formed proxy agent', () => {
const agent: Shifter = shifter.setIp();

expect(agent.axios.defaults.httpsAgent.proxy).toMatchSnapshot();
expect(agent.axios.defaults.httpAgent.proxy).toMatchSnapshot();
expect(agent.axios.defaults.httpsAgent.proxy.toString()).toMatch(new RegExp(`https://${proxy.host}:[0-9]+`));
expect(agent.axios.defaults.httpAgent.proxy.toString()).toMatch(new RegExp(`http://${proxy.host}:[0-9]+`));
});

it('creates a proxy agent having a random port among the given mapping', () => {
Expand All @@ -78,8 +78,8 @@ describe('Shifter', () => {
it('creates a properly formed proxy agent', () => {
const agent: Shifter = shifter.setIp();

expect(agent.axios.defaults.httpsAgent.proxy).toMatchSnapshot();
expect(agent.axios.defaults.httpAgent.proxy).toMatchSnapshot();
expect(agent.axios.defaults.httpsAgent.proxy.toString()).toMatch(new RegExp(`https://${proxy.host}:[0-9]+`));
expect(agent.axios.defaults.httpAgent.proxy.toString()).toMatch(new RegExp(`http://${proxy.host}:[0-9]+`));
});

it('create a proxy agent having a port matching one of the options in the mapping', () => {
Expand Down

0 comments on commit 27da30f

Please sign in to comment.