Skip to content

Commit

Permalink
fix(filter): match ONLY START portion of a spec name
Browse files Browse the repository at this point in the history
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 karma-runner#256 karma-runner#270
  • Loading branch information
parloti committed May 31, 2020
1 parent 3883acf commit ba910b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 + '"')
Expand Down

0 comments on commit ba910b2

Please sign in to comment.