Skip to content
This repository was archived by the owner on Sep 21, 2022. It is now read-only.

Commit ed4ece5

Browse files
committed
feat: remove backwards compatibility for passing grep to readTests
1 parent df35579 commit ed4ece5

File tree

3 files changed

+7
-22
lines changed

3 files changed

+7
-22
lines changed

doc/programmatic-api.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,17 @@ console.log(gemini.config.rootUrl);
3535

3636
## Reading the tests
3737

38-
`gemini.readTests(paths, grep)` — read all of the tests from specified paths into
38+
`gemini.readTests(paths, options)` — read all of the tests from specified paths into
3939
one suite collection.
4040

4141
* `paths` is an array of files or directories paths containing Gemini tests.
4242
If not specified, will look for tests in `$projectRoot/gemini` directory.
4343

44-
* `grep` is a regular expression to filter suites to read. By default, all tests
45-
will be read. If this option is set, only suites with name matching the
46-
pattern will be read.
44+
Options:
45+
46+
* `grep` — regular expression to filter suites to read. By default, all tests
47+
will be added to collection. If this option is set, only suites with name matching the
48+
pattern will be added to collection.
4749

4850
Returns promise which resolves to a `SuiteCollection` object.
4951

lib/gemini.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,7 @@ module.exports = class Gemini extends PassthroughEmitter {
8888
return this._exec(() => this._run(StateProcessor.createTester(this.config), paths, options));
8989
}
9090

91-
readTests(paths, options) {
92-
if (_.isRegExp(options)) {
93-
console.warn(chalk.yellow(
94-
`Passing grep to readTests is deprecated. You should pass an object with options: {grep: ${options}}.`
95-
));
96-
97-
options = {grep: options};
98-
} else {
99-
options = options || {};
100-
}
101-
91+
readTests(paths, options = {}) {
10292
return this._exec(() => this._readTests(paths, options));
10393
}
10494

test/unit/gemini.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,6 @@ describe('gemini', () => {
340340
assert.include(allSuites, matchingBranchLeaf);
341341
});
342342
});
343-
344-
it('should warn if RegExp was passed instead of object', () => {
345-
return readTests_(null, new RegExp(/string/))
346-
.then(() => assert.calledWith(console.warn, sinon.match(
347-
'Passing grep to readTests is deprecated. You should pass an object with options: {grep: /string/}.'
348-
)));
349-
});
350343
});
351344

352345
describe('test', () => {

0 commit comments

Comments
 (0)