()
| 109 | } |
| 110 | |
| 111 | function validate() { |
| 112 | if (process.env.CI !== "true" || process.env.TRAVIS !== "true") { |
| 113 | throw new Error(`@commitlint/travis-cli is intended to be used on Travis CI`); |
| 114 | } |
| 115 | |
| 116 | const missing = REQUIRED.filter((envVar) => !(envVar in process.env)); |
| 117 | |
| 118 | if (missing.length > 0) { |
| 119 | const stanza = missing.length > 1 ? "they were not" : "it was not"; |
| 120 | throw new Error(`Expected ${missing.join(", ")} to be defined globally, ${stanza}.`); |
| 121 | } |
| 122 | } |
no test coverage detected