index.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. "use strict";
  2. var __importDefault = (this && this.__importDefault) || function (mod) {
  3. return (mod && mod.__esModule) ? mod : { "default": mod };
  4. };
  5. Object.defineProperty(exports, "__esModule", { value: true });
  6. const discriminatedUnion_1 = __importDefault(require("./discriminatedUnion"));
  7. const object_1 = __importDefault(require("./object"));
  8. const primitives_1 = __importDefault(require("./primitives"));
  9. const realworld_1 = __importDefault(require("./realworld"));
  10. const string_1 = __importDefault(require("./string"));
  11. const union_1 = __importDefault(require("./union"));
  12. const argv = process.argv.slice(2);
  13. let suites = [];
  14. if (!argv.length) {
  15. suites = [
  16. ...realworld_1.default.suites,
  17. ...primitives_1.default.suites,
  18. ...string_1.default.suites,
  19. ...object_1.default.suites,
  20. ...union_1.default.suites,
  21. ...discriminatedUnion_1.default.suites,
  22. ];
  23. }
  24. else {
  25. if (argv.includes("--realworld")) {
  26. suites.push(...realworld_1.default.suites);
  27. }
  28. if (argv.includes("--primitives")) {
  29. suites.push(...primitives_1.default.suites);
  30. }
  31. if (argv.includes("--string")) {
  32. suites.push(...string_1.default.suites);
  33. }
  34. if (argv.includes("--object")) {
  35. suites.push(...object_1.default.suites);
  36. }
  37. if (argv.includes("--union")) {
  38. suites.push(...union_1.default.suites);
  39. }
  40. if (argv.includes("--discriminatedUnion")) {
  41. suites.push(...discriminatedUnion_1.default.suites);
  42. }
  43. }
  44. for (const suite of suites) {
  45. suite.run();
  46. }