Skip to content
This repository has been archived by the owner on Dec 22, 2020. It is now read-only.

Commit

Permalink
Merge pull request #39 from wirmar/patch-1
Browse files Browse the repository at this point in the history
added recursive loading setup example
  • Loading branch information
tricoder42 authored Aug 10, 2016
2 parents c8948a2 + 76e77b1 commit 2f3642b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,27 @@ webpack-dev-server 'mocha!./my-client-tests.js' --options webpackOptions.js
``` text
enhanced-require 'mocha!./my-server-tests.js'
```

### webpack.config.js
### Config
#### webpack.config.js

```js

module.exports = {
entry: 'mocha!./entry-file.js',
entry: './entry-file.js',
output: {
path: __dirname,
filename: 'bundle.js'
}
}
```

#### entry-file.js
```js
/*additional setup with other loaders (polyfills, ...)*/
const context = require.context(/*directory*/'mocha!./tests', /*recursive*/true, /*match files*//_test.js$/);
context.keys().forEach(context);
```

## License

MIT (http://www.opensource.org/licenses/mit-license.php)

0 comments on commit 2f3642b

Please sign in to comment.