(stderr, options = {})
| 129 | .trim(); |
| 130 | |
| 131 | export const normalizeStderr = (stderr, options = {}) => { |
| 132 | let normalizedStderr = util.stripVTControlCharacters(stderr); |
| 133 | |
| 134 | normalizedStderr = normalizedStderr |
| 135 | .replaceAll("\\", "/") |
| 136 | .replaceAll(new RegExp(process.cwd().replaceAll("\\", "/"), "g"), "<cwd>") |
| 137 | .replaceAll(new RegExp(os.tmpdir().replaceAll("\\", "/"), "g"), "<tmp>") |
| 138 | .replaceAll(new RegExp("\\\\.\\pipe".replaceAll("\\", "/"), "g"), "<tmp>") |
| 139 | .replaceAll(new RegExp(ipV4, "g"), "<ip-v4>") |
| 140 | .replaceAll(new RegExp(ipV6, "g"), "<ip-v6>"); |
| 141 | |
| 142 | // normalize node warnings |
| 143 | normalizedStderr = normalizedStderr.replaceAll( |
| 144 | /.*DeprecationWarning.*(\n)*/gm, |
| 145 | "", |
| 146 | ); |
| 147 | normalizedStderr = normalizedStderr.replaceAll( |
| 148 | /.*Use `node --trace-deprecation ...` to show where the warning was created.*(\n)*/gm, |
| 149 | "", |
| 150 | ); |
| 151 | |
| 152 | normalizedStderr = normalizedStderr.split("\n"); |
| 153 | normalizedStderr = normalizedStderr.filter( |
| 154 | (item) => !/.+wait until bundle finished.*(\n)?/g.test(item), |
| 155 | ); |
| 156 | normalizedStderr = normalizedStderr.join("\n"); |
| 157 | normalizedStderr = normalizedStderr.replaceAll(/:[0-9]+\//g, ":<port>/"); |
| 158 | |
| 159 | if (options.https) { |
| 160 | // We have deprecation warning on windows in some cases |
| 161 | normalizedStderr = normalizedStderr.split("\n"); |
| 162 | normalizedStderr = normalizedStderr.filter( |
| 163 | (item) => !/Generating SSL certificate/gi.test(item), |
| 164 | ); |
| 165 | normalizedStderr = normalizedStderr.filter( |
| 166 | (item) => |
| 167 | !/DeprecationWarning: The legacy HTTP parser is deprecated/g.test(item), |
| 168 | ); |
| 169 | normalizedStderr = normalizedStderr.join("\n"); |
| 170 | } |
| 171 | |
| 172 | if (normalizedStderr.includes("Loopback:")) { |
| 173 | normalizedStderr = normalizedStderr.split("\n"); |
| 174 | |
| 175 | const loopbackIndex = normalizedStderr.findIndex((item) => |
| 176 | /Loopback:/.test(item), |
| 177 | ); |
| 178 | |
| 179 | const protocol = options.https ? "https" : "http"; |
| 180 | |
| 181 | normalizedStderr[loopbackIndex] = |
| 182 | `<i> Loopback: ${protocol}://localhost:<port>/, ${protocol}://<ip-v4>:<port>/, ${protocol}://[<ip-v6>]:<port>/`; |
| 183 | normalizedStderr = normalizedStderr.join("\n"); |
| 184 | } |
| 185 | |
| 186 | if (options.ipv6 && !normalizedStderr.includes("On Your Network (IPv6):")) { |
| 187 | // Github Actions doesn't support IPv6 on ubuntu in some cases |
| 188 | normalizedStderr = normalizedStderr.split("\n"); |
no outgoing calls
no test coverage detected
searching dependent graphs…