From e964fa60ad63826e2e85f712eb119c524f4ef428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sampo=20Kivist=C3=B6?= Date: Wed, 11 May 2022 13:17:35 +0300 Subject: [PATCH] fix: fixes matches performance issue, github#302 --- src/adapter.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/adapter.js b/src/adapter.js index 047a90f..2552c25 100644 --- a/src/adapter.js +++ b/src/adapter.js @@ -457,11 +457,10 @@ var KarmaSpecFilter = function (clientConfig, jasmineEnv) { specs } - this.specIdsToRun = - getSpecsToRun(window.location, clientConfig, jasmineEnv).map(getId) + this.specIdsToRun = new Set(getSpecsToRun(window.location, clientConfig, jasmineEnv).map(getId)) this.matches = function (spec) { - return this.specIdsToRun.indexOf(spec.id) !== -1 + return this.specIdsToRun.has(spec.id) } }