mirror of
https://github.com/pezkuwichain/pezkuwi-dev.git
synced 2026-10-21 19:26:18 +00:00
dev-test: expose location in the browser environment
The browser environment copied window, document, navigator and localStorage onto the global, but not location. Code that reads the bare global, such as the apps URL type decoder, threw "location is not defined" while an ApiPromise was being created, so the api never became ready. location is now exposed with the other window objects.
This commit is contained in:
1 parent
13a6acf80d
commit
4e6a40ad14
2 files changed
+2
No files matched your search
+1
@@ -21,6 +21,7 @@ describe('browser', () => {
|
||||
it('contains the top-level objects', () => {
|
||||
expect(all.document).toBeDefined();
|
||||
expect(all.navigator).toBeDefined();
|
||||
expect(location.href).toBe('http://localhost/');
|
||||
});
|
||||
|
||||
it('contains HTML*Element', () => {
|
||||
|
||||
Vendored
+1
@@ -181,6 +181,7 @@ export function browser () {
|
||||
crypto: window.crypto,
|
||||
document: window.document,
|
||||
localStorage: window.localStorage,
|
||||
location: window.location,
|
||||
navigator: window.navigator,
|
||||
// window...
|
||||
window
|
||||
|
||||
Reference in new issue
Block a user