beatfactor/nightwatch — pull request #37 by t00f (2014-02-13 12:11:55+00:00)
Title: added -f option to filter filename formats. Uses minimatch module

If you use Javascript files to declare external variables/functions to be reusable in your tests, it is very convenient to have those files directly in your test folder.

For example, here is a test folders architecture:
```
tests/
common.js
/auth
common.js
tests_login_success.js
tests_login_failure.js
...
/books
common.js
tests_books_add.js
tests_books_edit.js
...
```
Files named common.js could be included in specific tests using ```require```.
``` javascript
// File: tests_login_success.js
var common = require('./common.js');

module.exports = {
// Write your nightwatch tests here
}
```

Option format (-f) enables to filter tests filenames. It can be combined with existing options

Usage example:
```
./nightwatch -g /tests -f tests*.js
```
It uses [minimatch](https://github.com/isaacs/minimatch) to deals with regex objects.

Original discussion was about [How to organize tests in real life?](https://github.com/beatfactor/nightwatch/issues/29)