# Controlling which tests get executed with ember-cli

**URL:** <https://discuss.emberjs.com/t/controlling-which-tests-get-executed-with-ember-cli/6962>\
**Category:** Testing\
**Created:** [December 20, 2014, 4:23pm UTC](https://discuss.emberjs.com/t/controlling-which-tests-get-executed-with-ember-cli/6962 "2014-12-20T16:23:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![solsberg](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/solsberg/32/9524_2.png) [@solsberg](https://discuss.emberjs.com/u/solsberg)\
**Post date:** [December 20, 2014, 4:23pm UTC](https://discuss.emberjs.com/t/controlling-which-tests-get-executed-with-ember-cli/6962/1 "2014-12-20T16:23:16Z")

</div>

I am looking for tips on how to control which tests get run from the ember-cli command line. For example, I sometimes want to run just my unit tests, or perhaps just the tests in a single test file.

So is there a way to filter the test files loaded by path name? e.g. ember test tests/unit/\*.js

Or perhaps even filter the tests which are run by some regex on test names?

Thanks

---

<div class="post-metadata">

**Author:** ![rwjblue](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/rwjblue/32/9411_2.png) [@rwjblue](https://discuss.emberjs.com/u/rwjblue)\
**Post date:** [December 20, 2014, 5:26pm UTC](https://discuss.emberjs.com/t/controlling-which-tests-get-executed-with-ember-cli/6962/2 "2014-12-20T17:26:00Z")

</div>

`ember test --filter="something-to-filter-by"` will run only tests that have `something-to-filter-by` in the module name or test name.

---

<div class="post-metadata">

**Author:** ![alexlafroscia](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/alexlafroscia/32/10701_2.png) [@alexlafroscia](https://discuss.emberjs.com/u/alexlafroscia)\
**Post date:** [April 14, 2015, 6:28pm UTC](https://discuss.emberjs.com/t/controlling-which-tests-get-executed-with-ember-cli/6962/4 "2015-04-14T18:28:19Z")

</div>

Is there some way to run the tests based on path to the test? I’m trying to build a tool for running tests based on their `path`, and I can’t figure out a way to do that reliably without knowing about the tests themselves (since you’d need to parse the file to determine the module or test name).

For example, I would like to be able to just run whatever tests are in `tests/unit/services/session-test.js`.

However, using `--filter` with…

- `services/session-test.js`
- `unit/services/session-test.js`
- `services/session`
- `service:session`

all don’t work. The only thing that seems to work is passing the module name specified in the file to the filter options, but that doesn’t work too nicely with that I’m trying to do since that string could be totally unrelated to the file name and path. Any suggestions?

---

<div class="post-metadata">

**Author:** ![danfinlay](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/danfinlay/32/9325_2.png) [@danfinlay](https://discuss.emberjs.com/u/danfinlay)\
**Post date:** [April 24, 2015, 4:51pm UTC](https://discuss.emberjs.com/t/controlling-which-tests-get-executed-with-ember-cli/6962/5 "2015-04-24T16:51:07Z")

</div>

Is there a way to pass a querystring to the browser tests when running `ember test --serve`? I’d love to run these with the container turned off, or skipping the jshint tests, or hiding passed tests on reload.

---

<div class="post-metadata">

**Author:** ![s12chung](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/s12chung/32/10999_2.png) [@s12chung](https://discuss.emberjs.com/u/s12chung)\
**Post date:** [June 18, 2015, 4:44pm UTC](https://discuss.emberjs.com/t/controlling-which-tests-get-executed-with-ember-cli/6962/6 "2015-06-18T16:44:53Z")

</div>

@danfinlay in your browser you can grep. for example: `http://localhost:7357/tests/index.html?hidepassed&grep=url%20must%20be%20escaped`

---

<div class="post-metadata">

**Author:** ![ahemed-haneen](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/ahemed-haneen/32/18175_2.png) [@ahemed-haneen](https://discuss.emberjs.com/u/ahemed-haneen)\
**Post date:** [September 27, 2023, 12:21pm UTC](https://discuss.emberjs.com/t/controlling-which-tests-get-executed-with-ember-cli/6962/7 "2023-09-27T12:21:39Z")

</div>

`Ember Exam` supports filtering by files, but i too am yet to find a solution to do the same in ember Test
