Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run specs with name containing '+' #8015

Merged
merged 6 commits into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/server/lib/util/escape_filename.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const ampersandRe = /&/g
const percentRe = /%/g
const questionRe = /\?/g
const plusRe = /\+/g

export function escapeFilenameInUrl (url: string) {
// escape valid file name characters that cannot be used in URL
return url
.replace(percentRe, '%25') // %
.replace(ampersandRe, '%26') // &
.replace(questionRe, '%3F') // ? -> it's only valid in Linux
.replace(plusRe, '%2B') // + https://github.com/cypress-io/cypress/issues/5909
}
4 changes: 2 additions & 2 deletions packages/server/test/e2e/4_controllers_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ describe('e2e plugins', () => {
})
})

it('handles specs with $, &, ? in file name', function () {
let relativeSpecPath = path.join('d?ir&1%', '%di?r2&', 's%pec&?.js')
it('handles specs with $, &, ?, + in file name', function () {
let relativeSpecPath = path.join('d?ir&1%', '%di?r2&', 's%p+ec&?.js')

// windows doesn't support ? in file names
if (process.platform === 'win32') {
Expand Down