Skip to content
This repository was archived by the owner on Sep 21, 2022. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ SetsBuilder
.useSets(['desktop']) // use only the specified sets
.useBrowsers(['bro1']) // use only specified browsers
.useFiles(['desktop/tests/test.js']) // use only specified files if sets
//and files to use are not specified
.build('/root', globOpts) // builds a collection of sets with paths expanded according
// to the project root and glob options
//and files to use are not specified
.build({root: '/root'}, globOpts) // builds a collection of sets with paths expanded according
// to the project root and glob options
.then((setCollection) => {
setCollection.groupByFile(); // groups all browsers of test-sets by file:
// {'desktop/tests/test.js': ['bro1']}
Expand Down
8 changes: 4 additions & 4 deletions lib/sets-builder/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const Promise = require('bluebird');
const SetCollection = require('./set-collection');
const TestSet = require('./test-set');

const EXPAND_OPTS = {formats: ['.js']};
const DEFAULT_EXPAND_OPTS = {formats: ['.js']};

module.exports = class SetsBuilder {
static create(sets, opts) {
Expand Down Expand Up @@ -62,12 +62,12 @@ module.exports = class SetsBuilder {
return this;
}

build(projectRoot, globOpts) {
const expandOpts = _.extend(EXPAND_OPTS, {root: projectRoot});
build(expandOpts, globOpts) {
expandOpts = _.extend(DEFAULT_EXPAND_OPTS, expandOpts);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_.extend({}, DEFAULT_EXPAND_OPTS, expandOpts);

globOpts = globOpts || {};

return this._transformDirsToMasks()
.then(() => this._resolvePaths(projectRoot))
.then(() => this._resolvePaths(expandOpts.root))
.then(() => globExtra.expandPaths(this._filesToUse, expandOpts, globOpts))
.then((expandedFiles) => this._useFiles(expandedFiles))
.then(() => this._expandFiles(expandOpts, globOpts))
Expand Down