Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
fix(configParser): use all the suites if no other spec sources are pr…
Browse files Browse the repository at this point in the history
…ovided
  • Loading branch information
fpipita authored and juliemr committed Feb 10, 2016
1 parent 550c3fb commit edfb52f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/configParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ ConfigParser.getSpecs = function(config) {
return config.specs;
}

Array.prototype.forEach.call(config.suites, function(suite) {
union(specs, makeArray(suite));
Object.keys(config.suites || {}).sort().forEach(function(suite) {
union(specs, makeArray(config.suites[suite]));
});
return specs;
};
Expand Down
16 changes: 16 additions & 0 deletions spec/unit/config_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,22 @@ describe('the config parser', function() {
expect(config.onPrepare).toEqual(path.normalize(process.cwd() + '/baz/qux.js'));
});

describe('getSpecs()', function() {
it('should return all the specs from "config.suites" if no other sources are provided', function() {
var config = {
specs: [],
suites: {
foo: 'foo.spec.js',
bar: 'bar.spec.js'
}
};

var specs = new ConfigParser.getSpecs(config);

expect(specs).toEqual(['bar.spec.js', 'foo.spec.js']);
});
});

describe('resolving globs', function() {
it('should resolve relative to the cwd', function() {
spyOn(process, 'cwd').and.returnValue(__dirname + '/');
Expand Down

0 comments on commit edfb52f

Please sign in to comment.