Files
cypress/cli/test/support/normalize.js
Gleb Bahmutov 72d9fae4e0 Pass arch when downloading 559 (#562)
* pass arch= when downloading desktop binary, close #559

* unit test url function
2017-10-05 13:38:47 +00:00

17 lines
423 B
JavaScript

const stripAnsi = require('strip-ansi')
const excessWhitespaceRe = /(\s{3,})/
const datesRe = /(\d+:\d+:\d+)/g
const downloadQueryRe = /(\?os=(mac|linux64|win)&arch=(x64|ia32))/
module.exports = (str) => {
// strip dates and ansi codes
// and excess whitespace
return stripAnsi(
str
.replace(datesRe, 'xx:xx:xx')
.replace(excessWhitespaceRe, ' ')
.replace(downloadQueryRe, '?os=OS&arch=ARCH')
)
}