mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-03 13:30:26 -05:00
Merge branch 'develop' into cache-sessions
# Conflicts: # packages/driver/src/cy/commands/sessions/index.ts
This commit is contained in:
@@ -45,6 +45,10 @@ exports['desktop url from template'] = `
|
||||
https://download.cypress.io/desktop/0.20.2/OS-ARCH/cypress.zip
|
||||
`
|
||||
|
||||
exports['desktop url from template with version'] = `
|
||||
https://mycompany/0.20.2/OS-ARCH/cypress.zip
|
||||
`
|
||||
|
||||
exports['desktop url from template with escaped dollar sign'] = `
|
||||
https://download.cypress.io/desktop/0.20.2/OS-ARCH/cypress.zip
|
||||
`
|
||||
|
||||
@@ -60,7 +60,7 @@ const getCA = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const prepend = (arch, urlPath) => {
|
||||
const prepend = (arch, urlPath, version) => {
|
||||
const endpoint = url.resolve(getBaseUrl(), urlPath)
|
||||
const platform = os.platform()
|
||||
const pathTemplate = util.getEnv('CYPRESS_DOWNLOAD_PATH_TEMPLATE', true)
|
||||
@@ -71,6 +71,7 @@ const prepend = (arch, urlPath) => {
|
||||
.replace(/\\?\$\{endpoint\}/, endpoint)
|
||||
.replace(/\\?\$\{platform\}/, platform)
|
||||
.replace(/\\?\$\{arch\}/, arch)
|
||||
.replace(/\\?\$\{version\}/, version)
|
||||
)
|
||||
: `${endpoint}?platform=${platform}&arch=${arch}`
|
||||
}
|
||||
@@ -82,7 +83,9 @@ const getUrl = (arch, version) => {
|
||||
return version
|
||||
}
|
||||
|
||||
return version ? prepend(arch, `desktop/${version}`) : prepend(arch, 'desktop')
|
||||
const urlPath = version ? `desktop/${version}` : 'desktop'
|
||||
|
||||
return prepend(arch, urlPath, version)
|
||||
}
|
||||
|
||||
const statusMessage = (err) => {
|
||||
|
||||
@@ -74,6 +74,13 @@ describe('lib/tasks/download', function () {
|
||||
snapshot('desktop url from template', normalize(url))
|
||||
})
|
||||
|
||||
it('returns custom url from template with version', () => {
|
||||
process.env.CYPRESS_DOWNLOAD_PATH_TEMPLATE = 'https://mycompany/${version}/${platform}-${arch}/cypress.zip'
|
||||
const url = download.getUrl('ARCH', '0.20.2')
|
||||
|
||||
snapshot('desktop url from template with version', normalize(url))
|
||||
})
|
||||
|
||||
it('returns custom url from template with escaped dollar sign', () => {
|
||||
process.env.CYPRESS_DOWNLOAD_PATH_TEMPLATE = '\\${endpoint}/\\${platform}-\\${arch}/cypress.zip'
|
||||
const url = download.getUrl('ARCH', '0.20.2')
|
||||
|
||||
Vendored
+5
@@ -3063,6 +3063,11 @@ declare namespace Cypress {
|
||||
interface ComponentConfigOptions<ComponentDevServerOpts = any> extends Omit<CoreConfigOptions, 'baseUrl' | 'experimentalSessionAndOrigin'> {
|
||||
devServer: DevServerFn<ComponentDevServerOpts> | DevServerConfigOptions
|
||||
devServerConfig?: ComponentDevServerOpts
|
||||
/**
|
||||
* Runs all component specs in a single tab, trading spec isolation for faster run mode execution.
|
||||
* @default false
|
||||
*/
|
||||
experimentalSingleTabRunMode?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user