codeceptjs 3.7.0-beta.17 → 3.7.0-beta.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/command/check.js +22 -8
- package/lib/plugin/retryTo.js +1 -1
- package/lib/plugin/tryTo.js +1 -1
- package/package.json +1 -1
package/lib/command/check.js
CHANGED
|
@@ -25,6 +25,7 @@ module.exports = async function (options) {
|
|
|
25
25
|
ai: true, // we don't need to check AI
|
|
26
26
|
helpers: false,
|
|
27
27
|
setup: false,
|
|
28
|
+
teardown: false,
|
|
28
29
|
tests: false,
|
|
29
30
|
def: false,
|
|
30
31
|
}
|
|
@@ -131,23 +132,36 @@ module.exports = async function (options) {
|
|
|
131
132
|
if (Object.keys(helpers).length) {
|
|
132
133
|
const suite = container.mocha().suite
|
|
133
134
|
const test = createTest('test', () => {})
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
checks.setup = true
|
|
136
|
+
for (const helper of Object.values(helpers)) {
|
|
137
|
+
try {
|
|
136
138
|
if (helper._beforeSuite) await helper._beforeSuite(suite)
|
|
137
139
|
if (helper._before) await helper._before(test)
|
|
140
|
+
} catch (err) {
|
|
141
|
+
err.message = `${helper.constructor.name} helper: ${err.message}`
|
|
142
|
+
if (checks.setup instanceof Error) err.message = `${err.message}\n\n${checks.setup?.message || ''}`.trim()
|
|
143
|
+
checks.setup = err
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
printCheck('Helpers Before', checks['setup'], standardActingHelpers.some(h => Object.keys(helpers).includes(h)) ? 'Initializing browser' : '')
|
|
148
|
+
|
|
149
|
+
checks.teardown = true
|
|
150
|
+
for (const helper of Object.values(helpers).reverse()) {
|
|
151
|
+
try {
|
|
138
152
|
if (helper._passed) await helper._passed(test)
|
|
139
153
|
if (helper._after) await helper._after(test)
|
|
140
154
|
if (helper._finishTest) await helper._finishTest(suite)
|
|
141
155
|
if (helper._afterSuite) await helper._afterSuite(suite)
|
|
156
|
+
} catch (err) {
|
|
157
|
+
err.message = `${helper.constructor.name} helper: ${err.message}`
|
|
158
|
+
if (checks.teardown instanceof Error) err.message = `${err.message}\n\n${checks.teardown?.message || ''}`.trim()
|
|
159
|
+
checks.teardown = err
|
|
142
160
|
}
|
|
143
|
-
checks.setup = true
|
|
144
|
-
} catch (err) {
|
|
145
|
-
err.message = `${helper.constructor.name} helper failed: ${err.message}`
|
|
146
|
-
checks.setup = err
|
|
147
161
|
}
|
|
148
|
-
}
|
|
149
162
|
|
|
150
|
-
|
|
163
|
+
printCheck('Helpers After', checks['teardown'], standardActingHelpers.some(h => Object.keys(helpers).includes(h)) ? 'Closing browser' : '')
|
|
164
|
+
}
|
|
151
165
|
|
|
152
166
|
try {
|
|
153
167
|
definitions(configFile, { dryRun: true })
|
package/lib/plugin/retryTo.js
CHANGED
|
@@ -6,7 +6,7 @@ const defaultConfig = {
|
|
|
6
6
|
|
|
7
7
|
module.exports = function (config) {
|
|
8
8
|
config = Object.assign(defaultConfig, config)
|
|
9
|
-
console.log(`Deprecation Warning: 'retryTo' has been moved to the 'codeceptjs/effects' module
|
|
9
|
+
console.log(`Deprecation Warning: 'retryTo' has been moved to the 'codeceptjs/effects' module. Disable retryTo plugin to remove this warning.`)
|
|
10
10
|
|
|
11
11
|
if (config.registerGlobal) {
|
|
12
12
|
global.retryTo = retryTo
|
package/lib/plugin/tryTo.js
CHANGED
|
@@ -6,7 +6,7 @@ const defaultConfig = {
|
|
|
6
6
|
|
|
7
7
|
module.exports = function (config) {
|
|
8
8
|
config = Object.assign(defaultConfig, config)
|
|
9
|
-
console.log(`Deprecation Warning: 'tryTo' has been moved to the 'codeceptjs/effects' module
|
|
9
|
+
console.log(`Deprecation Warning: 'tryTo' has been moved to the 'codeceptjs/effects' module. Disable tryTo plugin to remove this warning.`)
|
|
10
10
|
|
|
11
11
|
if (config.registerGlobal) {
|
|
12
12
|
global.tryTo = tryTo
|