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

Commit edfb52f

Browse files
fpipitajuliemr
authored andcommitted
fix(configParser): use all the suites if no other spec sources are provided
1 parent 550c3fb commit edfb52f

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

lib/configParser.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ ConfigParser.getSpecs = function(config) {
151151
return config.specs;
152152
}
153153

154-
Array.prototype.forEach.call(config.suites, function(suite) {
155-
union(specs, makeArray(suite));
154+
Object.keys(config.suites || {}).sort().forEach(function(suite) {
155+
union(specs, makeArray(config.suites[suite]));
156156
});
157157
return specs;
158158
};

spec/unit/config_test.js

+16
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,22 @@ describe('the config parser', function() {
3939
expect(config.onPrepare).toEqual(path.normalize(process.cwd() + '/baz/qux.js'));
4040
});
4141

42+
describe('getSpecs()', function() {
43+
it('should return all the specs from "config.suites" if no other sources are provided', function() {
44+
var config = {
45+
specs: [],
46+
suites: {
47+
foo: 'foo.spec.js',
48+
bar: 'bar.spec.js'
49+
}
50+
};
51+
52+
var specs = new ConfigParser.getSpecs(config);
53+
54+
expect(specs).toEqual(['bar.spec.js', 'foo.spec.js']);
55+
});
56+
});
57+
4258
describe('resolving globs', function() {
4359
it('should resolve relative to the cwd', function() {
4460
spyOn(process, 'cwd').and.returnValue(__dirname + '/');

0 commit comments

Comments
 (0)