-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: parseResponseHeaders with empty string return ealier (#7)
* fix: parseResponseHeaders with empty string return ealier * test: add helper test for parseResponseHeaders
- Loading branch information
1 parent
e6bc59e
commit ab4ed50
Showing
2 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { parseResponseHeaders } from '../src/helper'; | ||
|
||
describe('parseResponseHeaders tests', () => { | ||
test('mvp test', () => { | ||
const header = parseResponseHeaders('x-powered-by: msw'); | ||
expect(Object.keys(header).length).toBe(1); | ||
expect(header['x-powered-by']).toBe('msw'); | ||
}); | ||
|
||
test('empty header', () => { | ||
const header = parseResponseHeaders(''); | ||
expect(Object.keys(header).length).toBe(0); | ||
}); | ||
}); |