JRJurman / automated-ticket-printer

This project is an automated solution to print tickets and items as they get assigned.
MIT License
11 stars 1 forks source link

Tests should not have Hard-Coded values #3

Open JRJurman opened 8 years ago

JRJurman commented 8 years ago

The numbers for ticking the clock forward, and setting the watch intervals should not be hard-coded. We probably should expose a list of values in the tests/server folder, that detail what they are for.

e.g. possibly:

// tests/server/values
export const BEFORE_ONE_TICKET = 9;
export const ONE_TICKET = 10;
export const AFTER_ONE_TICKET = 11;
export const BEFORE_TWO_TICKETS = 19;
export const TWO_TICKETS = 20;
...
// tests/server/activity-watcher.spec.js
testActivityWatcher.addWatch(testWatch, ONE_TICKET);

clock.tick(BEFORE_ONE_TICKET);