-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: don't allow mutating original config object by the caller (#5)
`loadConfig` with `merge=false` was using spread operator to clone properties from fixture's configuration. Since that is a shallow copy, child objects were returned by reference and allowed caller to mutate those objects, affecting further uses of `loadConfig`. Ensure that is not possible by returning a copy of loaded config. This was a problem when one test loaded config and passed it to Nuxt Builder. Nuxt builder then appended generated plugins to plugins object and those plugins were then used by subsequent tests, even if it intended to build new, clean fixture.
- Loading branch information
1 parent
9375099
commit 642cd1b
Showing
4 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters