(value, expectedValid)
| 355 | } |
| 356 | |
| 357 | function assertValidation(value, expectedValid) { |
| 358 | const step = validationStep(); |
| 359 | assert.ok(step, "action.yml must add a validation step that references review_task_timeout"); |
| 360 | const fixture = makeFixture(); |
| 361 | try { |
| 362 | const result = runStep(step, inputValues({ review_task_timeout: value }), fixture); |
| 363 | if (expectedValid) { |
| 364 | assert.strictEqual(result.status, 0, `review_task_timeout=${JSON.stringify(value)} should be accepted; ${resultDescription(result)}`); |
| 365 | } else { |
| 366 | assert.notStrictEqual(result.status, 0, `review_task_timeout=${JSON.stringify(value)} should be rejected; ${resultDescription(result)}`); |
| 367 | } |
| 368 | } finally { |
| 369 | removeFixture(fixture); |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | function prRefsStep() { |
| 374 | const step = stepNamed("Resolve PR refs"); |
no test coverage detected