From ba910b205e97431433e9ef02d673aaa836fbb130 Mon Sep 17 00:00:00 2001 From: Alex Parloti Date: Sun, 31 May 2020 22:44:23 +0200 Subject: [PATCH] fix(filter): match ONLY START portion of a spec name jasmine tests are named suite-name + spec-name. The links printed by karma-jasmine-html-reporter include links for suite-name (only). To support running the suite, allow the filter to match ONLY the START portion of the test name. Fixes #256 #270 --- src/adapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adapter.js b/src/adapter.js index 241768a..4aa4278 100644 --- a/src/adapter.js +++ b/src/adapter.js @@ -350,7 +350,7 @@ function getId (s) { function getSpecsByName (specs, name) { specs = specs.filter(function (s) { - return s.name.indexOf(name) !== -1 + return s.name.startsWith(name) }) if (specs.length === 0) { throw new Error('No spec found with name: "' + name + '"')