Skip to content
This repository was archived by the owner on Jan 31, 2023. It is now read-only.

Commit 10e851b

Browse files
committed
register -> on & on:spec:file:preprocessor -> file:preprocessor
1 parent 73877ef commit 10e851b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ In your project's [plugins file](https://on.cypress.io/guides/plugins):
1717
```javascript
1818
const browserify = require('@cypress/browserify-preprocessor')
1919

20-
module.exports = (register, config) => {
21-
register('on:spec:file:preprocessor', browserify(config))
20+
module.exports = (on, config) => {
21+
on('file:preprocessor', browserify(config))
2222
}
2323
```
2424

@@ -27,15 +27,15 @@ module.exports = (register, config) => {
2727
Pass in options as the second argument to `browserify`:
2828

2929
```javascript
30-
module.exports = (register, config) => {
30+
module.exports = (on, config) => {
3131
const options = {
3232
extensions: [],
3333
watchOptions: {},
3434
transforms: [],
3535
onBundle () {},
3636
}
3737

38-
register('on:spec:file:preprocessor', browserify(config, options))
38+
on('file:preprocessor', browserify(config, options))
3939
}
4040
```
4141

@@ -116,11 +116,11 @@ If, for example, you want to update the options for the `babelify` transform to
116116
```javascript
117117
const browserify = require('@cypress/browserify-preprocessor')
118118

119-
module.exports = (register, config) => {
119+
module.exports = (on, config) => {
120120
const options = browserify.defaultOptions
121121
options.transforms[1].options.babelrc = true
122122

123-
register('on:spec:file:preprocessor', browserify(config, options))
123+
on('file:preprocessor', browserify(config, options))
124124
}
125125
```
126126

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const defaultOptions = {
5050
// export a function that returns another function, making it easy for users
5151
// to configure like so:
5252
//
53-
// register('on:spec:file:preprocessor', browserify(config, userOptions))
53+
// on('file:preprocessor', browserify(config, userOptions))
5454
//
5555
const preprocessor = (config, userOptions = {}) => {
5656
log('received user options', userOptions)
@@ -63,7 +63,7 @@ const preprocessor = (config, userOptions = {}) => {
6363
const options = Object.assign({}, defaultOptions, userOptions)
6464

6565
// we return function that accepts the arguments provided by
66-
// the event 'on:spec:file:preprocessor'
66+
// the event 'file:preprocessor'
6767
//
6868
// this function will get called for the support file when a project is loaded
6969
// (if the support file is not disabled)

0 commit comments

Comments
 (0)