Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test fails in other timezone #248

Open
hpawe01 opened this issue Nov 7, 2019 · 0 comments · May be fixed by #280
Open

Test fails in other timezone #248

hpawe01 opened this issue Nov 7, 2019 · 0 comments · May be fixed by #280

Comments

@hpawe01
Copy link
Contributor

hpawe01 commented Nov 7, 2019

When I run the tests on my Windows machine, I get the following error:
Expected '1348-04-06T23:06:32.000Z' to contain '1348-04-07'. The relevant test is it('should return serialized Schools from provided Array of Schools') (https://github.com/ghidoz/angular2-jsonapi/blob/master/projects/angular2-jsonapi/src/converters/json-model/json-model.converter.spec.ts#L139).

I believe the problem is, that my system converts that date other than expected, because I am in another timezone. I can fix this error by using the converted string for comparison:

const c = new DateConverter();
const convertedValue= c.unmask(c.mask(DATA[index].foundation));
expect(element.foundation).toContain(convertedValue);

But I don't know if this the correct way to handle this error or if we could configure the test environment to set a specific timezone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant