You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current behavior:
In a jest spec unit test test that the window.location.hostname is set when the href is set:
import{newSpecPage}from'@stencil/core/testing';describe('location.hostname',()=>{it('has a hostname',async()=>{constpage=awaitnewSpecPage({url:'http://test.example.com/',components: [],html: `<html></html>`,});expect(window.location.hostname).toEqual('test.example.com');});});
output:
FAIL src/components/location-hostname/test/location-hostname.spec.tsx
● location-hostname › has a hostname
expect(received).toEqual(expected) // deep equality
Expected: "test.example.com"
Received: ""
8 | html: `<html></html>`,
9 | });
> 10 | expect(window.location.hostname).toEqual('test.example.com');
| ^
11 | });
at Object.<anonymous> (src/components/location-hostname/test/location-hostname.spec.tsx:10:38)
As we can see the hostname is not set.
Expected behavior:
The hostname should be populated.
Stencil version:
I'm submitting a:
Current behavior:
In a jest spec unit test test that the
window.location.hostname
is set when thehref
is set:output:
As we can see the hostname is not set.
Expected behavior:
The hostname should be populated.
Steps to reproduce:
See current behaviour.
Related code:
https://github.com/ionic-team/stencil/blob/master/src/mock-doc/location.ts#L22
Other information:
I have a PR ready to submit to fix this, but the contributing guidelines said to create an issue first.
The text was updated successfully, but these errors were encountered: