()
| 71 | } |
| 72 | |
| 73 | function main() { |
| 74 | const opts = { |
| 75 | stdio: "inherit", |
| 76 | cwd: process.cwd(), |
| 77 | }; |
| 78 | |
| 79 | // Reset the test database |
| 80 | execSync("yarn db gm reset --shadow --erase", opts); |
| 81 | execSync("yarn db watch --once --shadow", opts); |
| 82 | |
| 83 | if (watchMode) { |
| 84 | // We're in watch mode, so keep watching the `current.yml` file |
| 85 | concurrently( |
| 86 | [ |
| 87 | { |
| 88 | name: "jest", |
| 89 | command: `cross-env NODE_OPTIONS=\"--inspect=9876\" jest -i ${watchMode}`, |
| 90 | prefixColor: "greenBright", |
| 91 | }, |
| 92 | { |
| 93 | name: "testdb", |
| 94 | command: "yarn db watch --shadow", |
| 95 | prefixColor: "blue", |
| 96 | }, |
| 97 | ], |
| 98 | { |
| 99 | killOthers: ["failure"], |
| 100 | } |
| 101 | ); |
| 102 | } else { |
| 103 | // Run once, so just run the tests |
| 104 | const argsWithoutDelayArg = cmdArgs.filter((arg) => arg !== "--delay"); |
| 105 | spawnSync("jest", ["-i", ...argsWithoutDelayArg], opts); |
| 106 | } |
| 107 | } |
no test coverage detected