karma-runner / karma-runner/karma

"nocache:true" option not working with "karma run"

Open
#2,822 3 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### Expected behaviour
Test run triggered by `karma run` should use latest contents of tests declared as `nocache:true`.

### Actual behaviour

Test run triggered by `karma run` uses previous contents of tests.

### Environment Details

```json
// package.json
{
"devDependencies": {
"karma": "1.7.0",
"karma-jasmine": "1.1.0",
"karma-phantomjs-launcher": "1.0.4",
"jasmine-core": "2.8.0"
}
}
```
```javascript
// karma.conf.js
module.exports = function(config) {
config.set({
frameworks: ['jasmine'],
files: [
{pattern:'test.js', nocache:true}
],
reporters: ['progress'],
port: 9876,
browsers: ['PhantomJS'],
singleRun: false,
autoWatch: false
})
};
```
```javascript
// test.js
describe('Array#indexOf()', function () {
it('should return -1 when the value is not present', function () {
expect([1, 2, 3].indexOf(4)).toBe(-1);
});
});
```

### Steps to reproduce the behaviour

1. Start karma server: `./node_modules/karma/bin/karma start`
It starts correctly.

2. Trigger the first test run:
```
./node_modules/karma/bin/karma run
PhantomJS 2.1.1 (Linux 0.0.0): Executed 1 of 1 SUCCESS (0.039 secs / 0.001 secs)
```
No failed tests, that's correct.

3. Change test to make it failing and rerun:
```
./node_modules/karma/bin/karma run
PhantomJS 2.1.1 (Linux 0.0.0): Executed 1 of 1 SUCCESS (0.04 secs / 0 secs)
```
Still no failed tests, incorrect.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.