File tree Expand file tree Collapse file tree 2 files changed +12
-32
lines changed Expand file tree Collapse file tree 2 files changed +12
-32
lines changed Original file line number Diff line number Diff line change 1
1
const { retryTo } = require ( '../effects' )
2
2
3
- module . exports = function ( config ) {
4
- console . log ( `
5
- Deprecation Warning: 'retryTo' has been moved to the effects module.
6
- You should update your tests to use it as follows:
7
-
8
- \`\`\`javascript
9
- const { retryTo } = require('codeceptjs/effects');
10
-
11
- // Example: Retry these steps 5 times before failing
12
- await retryTo((tryNum) => {
13
- I.switchTo('#editor frame');
14
- I.click('Open');
15
- I.see('Opened');
16
- }, 5);
17
- \`\`\`
3
+ const defaultConfig = {
4
+ registerGlobal : true ,
5
+ }
18
6
19
- For more details, refer to the documentation.
20
- ` )
7
+ module . exports = function ( config ) {
8
+ config = Object . assign ( defaultConfig , config )
9
+ console . log ( `Deprecation Warning: 'retryTo' has been moved to the 'codeceptjs/effects' module` )
21
10
22
11
if ( config . registerGlobal ) {
23
12
global . retryTo = retryTo
Original file line number Diff line number Diff line change 1
1
const { tryTo } = require ( '../effects' )
2
2
3
- module . exports = function ( config ) {
4
- console . log ( `
5
- Deprecated Warning: 'tryTo' has been moved to the effects module.
6
- You should update your tests to use it as follows:
7
-
8
- \`\`\`javascript
9
- const { tryTo } = require('codeceptjs/effects');
10
-
11
- // Example: failed step won't fail a test but will return true/false
12
- await tryTo(() => {
13
- I.switchTo('#editor frame');
14
- });
15
- \`\`\`
3
+ const defaultConfig = {
4
+ registerGlobal : true ,
5
+ }
16
6
17
- For more details, refer to the documentation.
18
- ` )
7
+ module . exports = function ( config ) {
8
+ config = Object . assign ( defaultConfig , config )
9
+ console . log ( `Deprecation Warning: 'tryTo' has been moved to the 'codeceptjs/effects' module` )
19
10
20
11
if ( config . registerGlobal ) {
21
12
global . tryTo = tryTo
You can’t perform that action at this time.
0 commit comments