Skip to content

Commit

Permalink
feature: add setHeaders test (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
levivilet authored Aug 27, 2024
1 parent c8531f0 commit 489b48d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/SetHeaders.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { expect, jest, test } from '@jest/globals'
import * as SetHeaders from '../src/parts/SetHeaders/SetHeaders.js'

test('setHeaders', () => {
const headers = {
A: '1',
}
const response = {
setHeader: jest.fn(),
}
SetHeaders.setHeaders(response, headers)
expect(response.setHeader).toHaveBeenCalledTimes(1)
expect(response.setHeader).toHaveBeenCalledWith('A', '1')
})

0 comments on commit 489b48d

Please sign in to comment.