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: Server-side environment #90

Open
andria-dev opened this issue May 1, 2020 · 2 comments
Open

Test: Server-side environment #90

andria-dev opened this issue May 1, 2020 · 2 comments
Labels
testing Related to testing of this package

Comments

@andria-dev
Copy link
Collaborator

We recently ran into an error that dealt with accessing navigator.language without ensuring we were in a client environment (the browser, or a place with access to a window). In light of this, we should add tests that ensure this doesn't happen again.

What needs to be done

Essentially, we just need to call every method and try to cause every edge case with the Window object disabled.

Sidenote:

This also makes me think that we might need to turn isClient into a function so that it can detect a change between server-side and client-side instead of it being a fixed value for testing purposes.

@andria-dev andria-dev changed the title Write tests to make sure that no errors occur in server-side environment Tests to make sure that no errors occur in server-side environment May 1, 2020
@andria-dev andria-dev changed the title Tests to make sure that no errors occur in server-side environment Tests/server-side environment May 1, 2020
@andria-dev andria-dev changed the title Tests/server-side environment Test: Server-side environment May 13, 2020
@andria-dev andria-dev added the testing Related to testing of this package label May 13, 2020
@dayhaysoos
Copy link
Owner

@ChrisBrownie55 wasn't this kind of addressed? We have logic that checks if isClient, if not, it defaults to some values.

@andria-dev
Copy link
Collaborator Author

andria-dev commented Jun 9, 2020

Yeah we addressed it in the libraries code but we don't have any tests to catch errors like that and prevent them from being reintroduced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Related to testing of this package
Projects
None yet
Development

No branches or pull requests

2 participants