-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add default GlobalFetch type to mock adapter
- Loading branch information
Showing
7 changed files
with
76 additions
and
74 deletions.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,57 +1,57 @@ | ||
import { parseUrl } from '../src/helper'; | ||
|
||
describe('parseUrl', () => { | ||
test('parse full url', () => { | ||
let parsed = parseUrl('http://xx.com/aa/bb'); | ||
expect(parsed).toStrictEqual({ | ||
pathname: '/aa/bb', | ||
query: {}, | ||
hash: '' | ||
}); | ||
|
||
parsed = parseUrl('//xx.com/aa/bb#555'); | ||
expect(parsed).toStrictEqual({ | ||
pathname: '/aa/bb', | ||
query: {}, | ||
hash: '#555' | ||
}); | ||
|
||
parsed = parseUrl('//xx.com/aa/bb?a=1&b=2&c=#555'); | ||
expect(parsed).toStrictEqual({ | ||
pathname: '/aa/bb', | ||
query: { | ||
a: '1', | ||
b: '2', | ||
c: '' | ||
}, | ||
hash: '#555' | ||
}); | ||
}); | ||
|
||
test('parse relative url', () => { | ||
let parsed = parseUrl('/aa/bb'); | ||
expect(parsed).toStrictEqual({ | ||
pathname: '/aa/bb', | ||
query: {}, | ||
hash: '' | ||
}); | ||
|
||
parsed = parseUrl('/aa/bb#555'); | ||
expect(parsed).toStrictEqual({ | ||
pathname: '/aa/bb', | ||
query: {}, | ||
hash: '#555' | ||
}); | ||
|
||
parsed = parseUrl('/aa/bb?a=1&b=2&c=#555'); | ||
expect(parsed).toStrictEqual({ | ||
pathname: '/aa/bb', | ||
query: { | ||
a: '1', | ||
b: '2', | ||
c: '' | ||
}, | ||
hash: '#555' | ||
}); | ||
}); | ||
}); | ||
import { parseUrl } from '../src/helper'; | ||
|
||
describe('parseUrl', () => { | ||
test('parse full url', () => { | ||
let parsed = parseUrl('http://xx.com/aa/bb'); | ||
expect(parsed).toStrictEqual({ | ||
pathname: '/aa/bb', | ||
query: {}, | ||
hash: '' | ||
}); | ||
|
||
parsed = parseUrl('//xx.com/aa/bb#555'); | ||
expect(parsed).toStrictEqual({ | ||
pathname: '/aa/bb', | ||
query: {}, | ||
hash: '#555' | ||
}); | ||
|
||
parsed = parseUrl('//xx.com/aa/bb?a=1&b=2&c=#555'); | ||
expect(parsed).toStrictEqual({ | ||
pathname: '/aa/bb', | ||
query: { | ||
a: '1', | ||
b: '2', | ||
c: '' | ||
}, | ||
hash: '#555' | ||
}); | ||
}); | ||
|
||
test('parse relative url', () => { | ||
let parsed = parseUrl('/aa/bb'); | ||
expect(parsed).toStrictEqual({ | ||
pathname: '/aa/bb', | ||
query: {}, | ||
hash: '' | ||
}); | ||
|
||
parsed = parseUrl('/aa/bb#555'); | ||
expect(parsed).toStrictEqual({ | ||
pathname: '/aa/bb', | ||
query: {}, | ||
hash: '#555' | ||
}); | ||
|
||
parsed = parseUrl('/aa/bb?a=1&b=2&c=#555'); | ||
expect(parsed).toStrictEqual({ | ||
pathname: '/aa/bb', | ||
query: { | ||
a: '1', | ||
b: '2', | ||
c: '' | ||
}, | ||
hash: '#555' | ||
}); | ||
}); | ||
}); |
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