Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

No filtering by test name if run with karma-sinon-chai framework #192

Open
segrey opened this issue May 31, 2017 · 2 comments
Open

No filtering by test name if run with karma-sinon-chai framework #192

segrey opened this issue May 31, 2017 · 2 comments

Comments

@segrey
Copy link

segrey commented May 31, 2017

Example project: https://github.com/tongrhj/karma-test/tree/cf4d63f6c91bd573adf224b626d2b96fce28488a
Steps to reproduce:

  1. Start server
./node_modules/karma/bin/karma start
  1. Run tests
./node_modules/karma/bin/karma run -- '--grep=Testing the throttle function calls callback after 100ms'

All tests are run unexpectedly.

Caused by executing karma.start() without passing config: https://github.com/kmees/karma-sinon-chai/blob/49b33ed97984dcadd87788606ca2131a7a0700da/chai-adapter.js#L17

Can be fixed on karma-sinon-chai side with

    karma.start(window.__karma__.config);

However, probably, it'd be better to make karma-mocha not dependent on correct behavior of 3rd party frameworks.
For example, karma-jasmine fetches config directly from karma object: https://github.com/karma-runner/karma-jasmine/blob/v1.1.0/src/adapter.js#L324. Is it possible to implement a similar scheme for karma-mocha?

@maksimr maksimr self-assigned this May 31, 2017
segrey added a commit to segrey/karma-mocha that referenced this issue May 25, 2018
@segrey
Copy link
Author

segrey commented May 25, 2018

This issue also affects running single test in project generated with vue init webpack my-project command (https://youtrack.jetbrains.com/issue/WEB-32918).
Please review PR: #206 //cc @maksimr

@lana-k
Copy link

lana-k commented May 5, 2020

Proposed solution implemented in karma-sinon-chai v2.0.1: kevicency/karma-sinon-chai@0c4ae58

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants