Skip to content

Commit b2a2e50

Browse files
nyghtly-derekmschileryanthemanuelBlue F
authored
fix: fix behavior when only using inverted tags (#24413)
* fix behavior when only using inverted tags * fix: fix behavior when only using inverted tags * yarn lint --fix ./npm/grep Co-authored-by: Matt Schile <mschile@cypress.io> Co-authored-by: Ryan Manuel <ryanm@cypress.io> Co-authored-by: Blue F <blue@cypress.io>
1 parent dbf4e47 commit b2a2e50

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

npm/grep/cypress/e2e/unit.js

+7
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,13 @@ describe('utils', () => {
153153
],
154154
])
155155
})
156+
157+
it('allows all tags to be inverted', () => {
158+
const parsed = parseTagsGrep('--@tag1,--@tag2')
159+
expect(parsed).to.deep.equal([
160+
[ { tag: '@tag1', invert: true }, { tag: '@tag2', invert: true } ]
161+
])
162+
})
156163
})
157164

158165
context('parseGrep', () => {

npm/grep/src/utils.js

+4
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ function parseTagsGrep (s) {
8686
ORS_filtered.forEach((OR, index) => {
8787
ORS_filtered[index] = OR.concat(explicitNotTags)
8888
})
89+
90+
if (ORS_filtered.length === 0) {
91+
ORS_filtered[ 0 ] = explicitNotTags
92+
}
8993
}
9094

9195
return ORS_filtered

0 commit comments

Comments
 (0)