Skip to content

Instantly share code, notes, and snippets.

@twolfson
Created August 25, 2015 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twolfson/e67e4bbc26d037522a68 to your computer and use it in GitHub Desktop.
Save twolfson/e67e4bbc26d037522a68 to your computer and use it in GitHub Desktop.
Managing nine-track fixtures at scale

At some point, nine-track fixtures become unwieldy to copy/paste by hand. Sometimes you add new HTTP request to a show page and wind up needing to add a new fixture to 20 tests. That is not fun.

Instead of this, we are trying out to use concat with a set of defaults:

// In our fake-server.js
fakeServer.userShowDefaults = [
  'first-fixture', 'proxy'
];

// In our test
fakeServer.run(fakeServer.userShowDefaults);
// Or override by putting our overrides first via `concat`
fakeServer.run([
  'first-fixture-override'
].concat(fakeServer.userShowDefaults));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment