|
1 |
| -import fetch, { response } from '../src/index.mjs'; |
| 1 | +import fetch from '../src/index.mjs'; |
2 | 2 | import fetchDist from '..';
|
3 | 3 |
|
4 | 4 | describe('unfetch', () => {
|
@@ -81,33 +81,4 @@ describe('unfetch', () => {
|
81 | 81 | return p;
|
82 | 82 | });
|
83 | 83 | });
|
84 |
| - |
85 |
| - describe('response()', () => { |
86 |
| - it('returns text()', () => response({ responseText: 'A passing test.' }) |
87 |
| - .text() |
88 |
| - .then((text) => expect(text).toBe('A passing test.')) |
89 |
| - ); |
90 |
| - |
91 |
| - it('returns blob()', () => response({ response: 'A passing test.' }) |
92 |
| - .blob() |
93 |
| - .then((text) => expect(text.toString()).toBe(new Blob(['A passing test.']).toString())) |
94 |
| - ); |
95 |
| - |
96 |
| - it('returns headers', () => { |
97 |
| - const all = [['x-foo', 'bar'], ['x-baz', 'boo']]; |
98 |
| - const result = response({}, { all }).headers.entries(); |
99 |
| - expect(result).toEqual(all); |
100 |
| - }); |
101 |
| - |
102 |
| - it('returns header keys', () => { |
103 |
| - const result = response({}, { keys: ['x-foo'] }).headers.keys(); |
104 |
| - expect(result).toEqual(['x-foo']); |
105 |
| - }); |
106 |
| - |
107 |
| - it('returns headers has', () => { |
108 |
| - const raw = { 'x-foo': 'bar', 'x-baz': 'boo' }; |
109 |
| - const test = response({}, { raw }).headers; |
110 |
| - expect(test.has('x-foo')).toBe(true); |
111 |
| - }); |
112 |
| - }); |
113 | 84 | });
|
0 commit comments