Skip to content

Commit

Permalink
test: update the fromTraffic unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
weyert committed May 26, 2024
1 parent 97d1f80 commit abb022b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/traffic/fromTraffic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { fromTraffic } from '../../src/fromTraffic/fromTraffic'
import { decodeBase64String } from '../../src/fromTraffic/utils/decodeBase64String'
import { readArchive } from './utils'
import { toResponse } from '../../src/fromTraffic/utils/harUtils'
import { inspectHandlers } from '../support/inspectHandler'

describe('fromTraffic', () => {
it('throws an exception given no HAR object', () => {
Expand Down Expand Up @@ -42,7 +43,7 @@ describe('fromTraffic', () => {
})
})

it('supports skipping an entry using the "mapEntry" function', () => {
it('supports skipping an entry using the "mapEntry" function', async () => {
const handlers = fromTraffic(
{
log: {
Expand Down Expand Up @@ -80,7 +81,11 @@ describe('fromTraffic', () => {
)

expect(handlers).toHaveLength(1)
expect(handlers[0].info.header).toEqual('get https://api.stripe.com')
const [initialRequestHandler] = await inspectHandlers(handlers)
expect(initialRequestHandler.handler).toEqual({
method: 'GET',
path: 'https://api.stripe.com',
})
})
})

Expand Down

0 comments on commit abb022b

Please sign in to comment.