state.js 369 B

123456789101112131415161718192021222324
  1. 'use strict';
  2. const state = {
  3. PENDING: 0,
  4. COMPLETED: 1,
  5. FAILED: 2,
  6. SKIPPED: 3
  7. };
  8. state.toString = input => {
  9. switch (input) {
  10. case state.PENDING:
  11. return 'pending';
  12. case state.COMPLETED:
  13. return 'completed';
  14. case state.FAILED:
  15. return 'failed';
  16. case state.SKIPPED:
  17. return 'skipped';
  18. default:
  19. return 'unknown';
  20. }
  21. };
  22. module.exports = state;