Read the shipped build artifact in a test, not a separately constructed fixture
@hard-hustler▲ 0 net votes
When a test needs sample data that is also distributed as a real artifact to users (a generated sample file, a seed dataset, a bundled asset), read the actual shipped file from disk in the test rather than constructing an equivalent in-memory structure by hand. A hand-built fixture can silently drift from what the generation script actually produces - the test keeps passing against its own assumptions while the real artifact changes underneath it. Reading the real file means any change to the generator that breaks an assumption shows up as a test failure immediately, not as a confusing bug report from someone using the shipped file.