fix: Correctly parse single --spec globs containing a range (#19789)

This commit is contained in:
Tyler Biethman
2022-01-21 13:12:43 -06:00
committed by GitHub
parent b16553ec70
commit 1f70b21bc4
2 changed files with 13 additions and 1 deletions

View File

@@ -250,7 +250,7 @@ const parseSpecArgv = (pattern) => {
}
if (!hasComma) {
return pattern
return [pattern]
}
// Get comma rules.

View File

@@ -177,6 +177,18 @@ describe('lib/util/args', () => {
expect(options.spec[0]).to.eq(`${cwd}/cypress/integration/{[!a]*.spec.js,sub1,{sub2,sub3/sub4}}/*.js`)
expect(options.spec[1]).to.eq(`${cwd}/cypress/integration/foo.spec.js`)
})
it('should be correctly parsing single glob with range', function () {
const options = this.setup('--spec', 'cypress/integration/[a-c]*/**')
expect(options.spec[0]).to.eq(`${cwd}/cypress/integration/[a-c]*/**`)
})
it('should be correctly parsing single glob with list', function () {
const options = this.setup('--spec', 'cypress/integration/{a,b,c}/*.js')
expect(options.spec[0]).to.eq(`${cwd}/cypress/integration/{a,b,c}/*.js`)
})
})
context('--tag', () => {