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

Reset config to default between tests #79

Open
Perizote opened this issue May 13, 2021 · 0 comments
Open

Reset config to default between tests #79

Perizote opened this issue May 13, 2021 · 0 comments
Assignees

Comments

@Perizote
Copy link
Contributor

Perizote commented May 13, 2021

We have a way of setting the config to the "project's default" per project, but we might need burrito to reset it to default before it does in projects.

What do we achieve with this?
Because these config properties that aren't set in the project's default won't be reset if are configured in a specific test, making all the tests inheriting this config that might not be necessary or might even cause inconsistencies.

We tried to fix it by doing this, but in the end we found out that we didn't understood the problem well. What happens is that we set the project config for burrito in the jest's setupFilesAfterEnv, which we thought was being applied before each test but instead is applied before each test file. This means the first test of every test file is gonna have the configuration reset but the following tests are gonna be inheriting the state of the config of the previous tests.

In order to fully fix it, we would need to stop using jest's setupFilesAfterEnv to set the burrito's config for our projects and add a mechanism to burrito so that projects using it could add its custom config and it is applied before each test.

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

Successfully merging a pull request may close this issue.

1 participant