Skip to content

Commit d68e426

Browse files
committed
updated tests
fixed skip already excludes selectors
1 parent aba505f commit d68e426

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/options/selectorLibrary.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,12 +269,20 @@ class SelectorLibrary {
269269
if (!toExclude) return;
270270

271271
if (typeof toExclude === 'string') {
272+
if (this.contains.call(this.excludes, toExclude)) {
273+
return
274+
}
275+
272276
(this.excludes).push(toExclude);
273277

274278
return;
275279
}
276280

277281
for (let e of toExclude) {
282+
if (this.contains.call(this.excludes, e)) {
283+
continue;
284+
}
285+
278286
(this.excludes).push(e);
279287
}
280288
} // /setExclude

test/selectorLibrary.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ describe('rcs selector library', () => {
198198
});
199199
});
200200

201-
describe.only('setExclude', () => {
201+
describe('setExclude', () => {
202202
beforeEach(() => {
203203
rcs.selectorLibrary.excludes = []
204204
});

0 commit comments

Comments
 (0)