[Changed] Reset config to burrito's default between tests #95
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎩 What?
Reset config to burrito's default between tests
🤔 Why?
So that this issue gets closed.
We have seen in the past how not doing a reset of the config to what burrito knows as default have caused inconsistent behaviour. I believe @juandiegombr and @maurogestoso have experienced this issue as well when playing with the configuration of the
history
. Doing a reset of the config between tests just before jest executes its loop to apply the default config we've set per project should do the trick.🧪 How has this been tested? / 💥 How will I know if this breaks?
Added a test that checks that the config is the burrito's default even tho it is the last test of the suite. To be honest, I don't like this test because tests shouldn't be aware of the order they are being executed and so executing it the first of the suite would make it pass without having to change the code 🤷♂️ .
A few other tests from other suites had been updated because they were passing just because the config wasn't being reset.
🗣️ Comments
We were actually doing something similar in one of our tests as a helper. Now we can get rid of it and works globally.