# Karma singleRun

**URL:** <https://travis-ci.community/t/karma-singlerun/13235>\
**Category:** Deployment\
**Created:** [August 24, 2022, 7:51pm UTC](https://travis-ci.community/t/karma-singlerun/13235 "2022-08-24T19:51:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Northskool](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/northskool/32/8176_2.png) [@Northskool](https://travis-ci.community/u/Northskool)\
**Post date:** [August 24, 2022, 7:51pm UTC](https://travis-ci.community/t/karma-singlerun/13235/1 "2022-08-24T19:51:14Z")

</div>

On my local machine I want `npm test` to watch files and re-test on change, so I use `singleRun: false` in `karma.conf.js`. This is pretty standard.

On Travis. this causes a timeout error. How do I override the `singleRun` option for `travis-ci` environment only?

---

<div class="post-metadata">

**Author:** ![Montana](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/montana/32/9566_2.png) [@Montana](https://travis-ci.community/u/Montana)\
**Post date:** [August 24, 2022, 7:52pm UTC](https://travis-ci.community/t/karma-singlerun/13235/2 "2022-08-24T19:52:22Z")

</div>

Hi @Northskool,

For this, you can use node’s `process.env` function to set a local `var` to the value of `CI` (or false if unset), then use this as the value for `singleRun` in the config.

So your `karma.conf.js` will look something like this:

```javascript
const ci = process.env.CI || false

module.exports = function(config) {
  config.set({
    singleRun: ci,
    ...
 }
}

```
