diff --git a/doc/programmatic-api.md b/doc/programmatic-api.md index c8db4a09b..69f2c73dd 100644 --- a/doc/programmatic-api.md +++ b/doc/programmatic-api.md @@ -35,15 +35,17 @@ console.log(gemini.config.rootUrl); ## Reading the tests -`gemini.readTests(paths, grep)` — read all of the tests from specified paths into +`gemini.readTests(paths, options)` — read all of the tests from specified paths into one suite collection. * `paths` is an array of files or directories paths containing Gemini tests. If not specified, will look for tests in `$projectRoot/gemini` directory. -* `grep` is a regular expression to filter suites to read. By default, all tests - will be read. If this option is set, only suites with name matching the - pattern will be read. +Options: + +* `grep` — regular expression to filter suites to read. By default, all tests + will be added to collection. If this option is set, only suites with name matching the + pattern will be added to collection. Returns promise which resolves to a `SuiteCollection` object. diff --git a/lib/gemini.js b/lib/gemini.js index 818002761..fbc3e6d8f 100644 --- a/lib/gemini.js +++ b/lib/gemini.js @@ -88,17 +88,7 @@ module.exports = class Gemini extends PassthroughEmitter { return this._exec(() => this._run(StateProcessor.createTester(this.config), paths, options)); } - readTests(paths, options) { - if (_.isRegExp(options)) { - console.warn(chalk.yellow( - `Passing grep to readTests is deprecated. You should pass an object with options: {grep: ${options}}.` - )); - - options = {grep: options}; - } else { - options = options || {}; - } - + readTests(paths, options = {}) { return this._exec(() => this._readTests(paths, options)); } diff --git a/test/unit/gemini.js b/test/unit/gemini.js index 2da29d9e9..12f48790d 100644 --- a/test/unit/gemini.js +++ b/test/unit/gemini.js @@ -340,13 +340,6 @@ describe('gemini', () => { assert.include(allSuites, matchingBranchLeaf); }); }); - - it('should warn if RegExp was passed instead of object', () => { - return readTests_(null, new RegExp(/string/)) - .then(() => assert.calledWith(console.warn, sinon.match( - 'Passing grep to readTests is deprecated. You should pass an object with options: {grep: /string/}.' - ))); - }); }); describe('test', () => {