diff --git a/cli/lib/tasks/install.js b/cli/lib/tasks/install.js index ecbd804c5b58..0318619c92b7 100644 --- a/cli/lib/tasks/install.js +++ b/cli/lib/tasks/install.js @@ -85,7 +85,7 @@ const getVersionSpecifier = (startDir = path.resolve(__dirname, '../..')) => { }) } -const betaNpmUrlRe = /^\/beta\/npm\/(?[0-9.]+)\/(?[^/]+)\/cypress\.tgz$/ +const betaNpmUrlRe = /^\/beta\/npm\/(?[0-9.]+)\/(?.+?)\/cypress\.tgz$/ // convert a prerelease NPM package .tgz URL to the corresponding binary .zip URL const getBinaryUrlFromPrereleaseNpmUrl = (npmUrl) => { diff --git a/cli/test/lib/tasks/install_spec.js b/cli/test/lib/tasks/install_spec.js index 52dbb5d4ba94..f8a7d9f66e4f 100644 --- a/cli/test/lib/tasks/install_spec.js +++ b/cli/test/lib/tasks/install_spec.js @@ -472,6 +472,9 @@ describe('/lib/tasks/install', function () { expect(install._getBinaryUrlFromPrereleaseNpmUrl('https://cdn.cypress.io/beta/npm/5.1.1/circle-develop-3fdfc3b453eb38ad3c0b079531e4dde6668e3dd0-436710/cypress.tgz')) .to.eq('https://cdn.cypress.io/beta/binary/5.1.1/linux-x64/circle-develop-3fdfc3b453eb38ad3c0b079531e4dde6668e3dd0-436710/cypress.zip') + + expect(install._getBinaryUrlFromPrereleaseNpmUrl('https://cdn.cypress.io/beta/npm/5.1.1/circle-develop/some/branch-3fdfc3b453eb38ad3c0b079531e4dde6668e3dd0-436710/cypress.tgz')) + .to.eq('https://cdn.cypress.io/beta/binary/5.1.1/linux-x64/circle-develop/some/branch-3fdfc3b453eb38ad3c0b079531e4dde6668e3dd0-436710/cypress.zip') }) it('returns nothing for an invalid url', function () {