Skip to content

Support writing references to the fixtures#85

Open
holm wants to merge 6 commits intodomasx2:masterfrom
peakon:features/reference
Open

Support writing references to the fixtures#85
holm wants to merge 6 commits intodomasx2:masterfrom
peakon:features/reference

Conversation

@holm
Copy link
Copy Markdown

@holm holm commented Dec 18, 2017

This is a work-in-progress, and was mostly to see if there is any interest in this.

It supports giving a fixture a name, and writing out the primary key of the instance after it has been inserted. This is very convenient for unit tests, since you can reference the fixture by name rather than directly by id.

@papandreou
Copy link
Copy Markdown

@holm, I just ran into a failing test that was caused by another test accidentally modifying an object inside the value exported from the reference file. I think it would make sense to do a deep Object.freeze on the value to prevent that. In strict mode that would cause attempted mutations to throw a TypeError, which would help with tracking down the offending test.

Let me know if think it's a good idea, then I'll take a stab at it :)

@alexjeffburke alexjeffburke deleted the features/reference branch July 3, 2020 13:56
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 this pull request may close these issues.

2 participants