(job, i, config)
| 21 | }; |
| 22 | |
| 23 | const validateStringJob = async (job, i, config) => { |
| 24 | const errors = []; |
| 25 | |
| 26 | const jobNameError = validateReservedJobName(job); |
| 27 | if (jobNameError) { |
| 28 | throw jobNameError; |
| 29 | } |
| 30 | |
| 31 | if (!config.root) { |
| 32 | errors.push( |
| 33 | new Error( |
| 34 | `Job #${ |
| 35 | i + 1 |
| 36 | } "${job}" requires root directory option to auto-populate path` |
| 37 | ) |
| 38 | ); |
| 39 | throw combineErrors(errors); |
| 40 | } |
| 41 | |
| 42 | const path = join( |
| 43 | config.root, |
| 44 | getJobPath(job, config.acceptedExtensions, config.defaultExtension) |
| 45 | ); |
| 46 | |
| 47 | const stats = await fs.promises.stat(path); |
| 48 | if (!stats.isFile()) { |
| 49 | throw new Error(`Job #${i + 1} "${job}" path missing: ${path}`); |
| 50 | } |
| 51 | }; |
| 52 | |
| 53 | const validateFunctionJob = (job, i) => { |
| 54 | const errors = []; |
no test coverage detected
searching dependent graphs…