codeceptjs 3.7.6-beta.3 → 3.7.6

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.
@@ -108,6 +108,7 @@ module.exports = config => {
108
108
  event.dispatcher.on(event.test.before, test => {
109
109
  // pass disableRetryFailedStep is a preferred way to disable retries
110
110
  // test.disableRetryFailedStep is used for backward compatibility
111
+ if (!test.opts) test.opts = {}
111
112
  if (test.opts.disableRetryFailedStep || test.disableRetryFailedStep) {
112
113
  store.autoRetries = false
113
114
  return // disable retry when a test is not active
package/lib/result.js CHANGED
@@ -14,6 +14,11 @@ const { serializeTest } = require('./mocha/test')
14
14
  * @property {number} duration Duration of the test run, in milliseconds.
15
15
  */
16
16
 
17
+ /**
18
+ * @typedef {Array<string|number>} Failure
19
+ * A detailed formatted report for a failed test.
20
+ */
21
+
17
22
  /**
18
23
  * Result of a test run. Will be emitted for example in "event.all.result" events.
19
24
  */
@@ -48,7 +53,7 @@ class Result {
48
53
  this._tests = []
49
54
 
50
55
  /**
51
- * @type {string[][]}
56
+ * @type {Failure[]}
52
57
  * @private
53
58
  */
54
59
  this._failures = []
@@ -91,7 +96,7 @@ class Result {
91
96
  /**
92
97
  * The failure reports (array of strings per failed test).
93
98
  *
94
- * @type {string[][]}
99
+ * @type {Failure[]}
95
100
  * @readonly
96
101
  */
97
102
  get failures() {
@@ -136,7 +141,7 @@ class Result {
136
141
  /**
137
142
  * Adds failure reports to this result.
138
143
  *
139
- * @param {string[][]} newFailures
144
+ * @param {Failure[]} newFailures
140
145
  */
141
146
  addFailures(newFailures) {
142
147
  this._failures.push(...newFailures)
package/lib/step/base.js CHANGED
@@ -225,7 +225,7 @@ class Step {
225
225
  processingStep = this
226
226
 
227
227
  while (processingStep.metaStep) {
228
- if (processingStep.metaStep.actor?.match(/^(Given|When|Then|And)/)) {
228
+ if (processingStep.metaStep.actor?.match(/^(Given|When|Then|And|But)/)) {
229
229
  hasBDD = true
230
230
  break
231
231
  } else {
package/lib/step/meta.js CHANGED
@@ -15,7 +15,7 @@ class MetaStep extends Step {
15
15
 
16
16
  /** @return {boolean} */
17
17
  isBDD() {
18
- if (this.actor && this.actor.match && this.actor.match(/^(Given|When|Then|And)/)) {
18
+ if (this.actor && this.actor.match && this.actor.match(/^(Given|When|Then|And|But)/)) {
19
19
  return true
20
20
  }
21
21
  return false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeceptjs",
3
- "version": "3.7.6-beta.3",
3
+ "version": "3.7.6",
4
4
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
5
5
  "keywords": [
6
6
  "acceptance",
@@ -48,6 +48,9 @@
48
48
  "repository": "Codeception/codeceptjs",
49
49
  "scripts": {
50
50
  "test-server": "node bin/test-server.js test/data/rest/db.json --host 0.0.0.0 -p 8010",
51
+ "mock-server:start": "node test/mock-server/start-mock-server.js",
52
+ "mock-server:stop": "kill -9 $(lsof -t -i:3001)",
53
+ "test:with-mock-server": "npm run mock-server:start && npm test",
51
54
  "json-server:graphql": "node test/data/graphql/index.js",
52
55
  "lint": "eslint bin/ examples/ lib/ test/ translations/ runok.js",
53
56
  "lint-fix": "eslint bin/ examples/ lib/ test/ translations/ runok.js --fix",
@@ -88,7 +91,7 @@
88
91
  "@xmldom/xmldom": "0.9.8",
89
92
  "acorn": "8.15.0",
90
93
  "arrify": "3.0.0",
91
- "axios": "1.12.2",
94
+ "axios": "1.13.2",
92
95
  "chalk": "4.1.2",
93
96
  "cheerio": "^1.0.0",
94
97
  "chokidar": "^4.0.3",
@@ -100,19 +103,18 @@
100
103
  "escape-string-regexp": "4.0.0",
101
104
  "figures": "3.2.0",
102
105
  "fn-args": "4.0.0",
103
- "fs-extra": "11.3.2",
106
+ "fs-extra": "11.3.3",
104
107
  "fuse.js": "^7.0.0",
105
108
  "glob": ">=9.0.0 <12",
106
109
  "html-minifier-terser": "7.2.0",
107
110
  "inquirer": "^8.2.7",
108
111
  "invisi-data": "^1.0.0",
109
- "joi": "18.0.1",
112
+ "joi": "18.0.2",
110
113
  "js-beautify": "1.15.4",
111
114
  "lodash.clonedeep": "4.5.0",
112
115
  "lodash.merge": "4.6.2",
113
- "lodash.shuffle": "4.2.0",
114
116
  "mkdirp": "3.0.1",
115
- "mocha": "11.7.2",
117
+ "mocha": "11.7.5",
116
118
  "monocart-coverage-reports": "2.12.9",
117
119
  "ms": "2.1.3",
118
120
  "multer": "^2.0.2",
@@ -125,20 +127,20 @@
125
127
  "uuid": "11.1.0"
126
128
  },
127
129
  "optionalDependencies": {
128
- "@codeceptjs/detox-helper": "1.1.13"
130
+ "@codeceptjs/detox-helper": "1.1.14"
129
131
  },
130
132
  "devDependencies": {
131
133
  "@apollo/server": "^5",
132
134
  "@codeceptjs/expect-helper": "^1.0.2",
133
135
  "@codeceptjs/mock-request": "0.3.1",
134
- "@eslint/eslintrc": "3.3.1",
135
- "@eslint/js": "9.36.0",
136
+ "@eslint/eslintrc": "3.3.3",
137
+ "@eslint/js": "9.39.2",
136
138
  "@faker-js/faker": "9.8.0",
137
139
  "@pollyjs/adapter-puppeteer": "6.0.6",
138
140
  "@pollyjs/core": "6.0.6",
139
- "@types/chai": "5.2.2",
141
+ "@types/chai": "5.2.3",
140
142
  "@types/inquirer": "9.0.9",
141
- "@types/node": "^24.6.0",
143
+ "@types/node": "^24.6.2",
142
144
  "@wdio/sauce-service": "9.12.5",
143
145
  "@wdio/selenium-standalone-service": "8.15.0",
144
146
  "@wdio/utils": "9.19.2",
@@ -150,11 +152,11 @@
150
152
  "electron": "38.2.0",
151
153
  "eslint": "^9.36.0",
152
154
  "eslint-plugin-import": "2.32.0",
153
- "eslint-plugin-mocha": "11.1.0",
155
+ "eslint-plugin-mocha": "11.2.0",
154
156
  "expect": "30.2.0",
155
157
  "express": "^5.1.0",
156
158
  "globals": "16.4.0",
157
- "graphql": "16.11.0",
159
+ "graphql": "16.12.0",
158
160
  "graphql-tag": "^2.12.6",
159
161
  "husky": "9.1.7",
160
162
  "inquirer-test": "2.0.1",
@@ -168,15 +170,15 @@
168
170
  "qrcode-terminal": "0.12.0",
169
171
  "rosie": "2.1.1",
170
172
  "runok": "0.9.3",
171
- "semver": "7.7.2",
172
- "sinon": "21.0.0",
173
+ "semver": "7.7.3",
174
+ "sinon": "21.0.1",
173
175
  "sinon-chai": "3.7.0",
174
- "testcafe": "3.7.2",
176
+ "testcafe": "3.7.3",
175
177
  "ts-morph": "26.0.0",
176
178
  "ts-node": "10.9.2",
177
179
  "tsd": "^0.33.0",
178
180
  "tsd-jsdoc": "2.5.0",
179
- "typedoc": "0.28.13",
181
+ "typedoc": "0.28.16",
180
182
  "typedoc-plugin-markdown": "4.9.0",
181
183
  "typescript": "5.8.3",
182
184
  "wdio-docker-service": "3.2.1",
@@ -196,6 +198,7 @@
196
198
  }
197
199
  },
198
200
  "overrides": {
199
- "tmp": "0.2.5"
201
+ "tmp": "0.2.5",
202
+ "js-yaml": "^4.1.1"
200
203
  }
201
204
  }
@@ -11601,6 +11601,10 @@ declare namespace CodeceptJS {
11601
11601
  * Loads tests by pattern or by config.tests
11602
11602
  */
11603
11603
  loadTests(pattern?: string): void;
11604
+ /**
11605
+ * Fisher–Yates shuffle (non-mutating)
11606
+ */
11607
+ shuffle(): void;
11604
11608
  /**
11605
11609
  * Apply sharding to test files based on shard configuration
11606
11610
  * @param testFiles - Array of test file paths
@@ -11679,6 +11683,10 @@ declare namespace CodeceptJS {
11679
11683
  end: Date;
11680
11684
  duration: number;
11681
11685
  };
11686
+ /**
11687
+ * A detailed formatted report for a failed test.
11688
+ */
11689
+ type Failure = (string | number)[];
11682
11690
  /**
11683
11691
  * Result of a test run. Will be emitted for example in "event.all.result" events.
11684
11692
  */
@@ -11706,7 +11714,7 @@ declare namespace CodeceptJS {
11706
11714
  /**
11707
11715
  * The failure reports (array of strings per failed test).
11708
11716
  */
11709
- readonly failures: string[][];
11717
+ readonly failures: Failure[];
11710
11718
  /**
11711
11719
  * The test statistics.
11712
11720
  */
@@ -11722,7 +11730,7 @@ declare namespace CodeceptJS {
11722
11730
  /**
11723
11731
  * Adds failure reports to this result.
11724
11732
  */
11725
- addFailures(newFailures: string[][]): void;
11733
+ addFailures(newFailures: Failure[]): void;
11726
11734
  /**
11727
11735
  * Whether this result contains any failed tests.
11728
11736
  */
@@ -12117,7 +12125,10 @@ declare namespace CodeceptJS {
12117
12125
  * Print a text in console log
12118
12126
  */
12119
12127
  function say(message: string, color?: string): void;
12120
- function result(passed: number, failed: number, skipped: number, duration: number | string): void;
12128
+ /**
12129
+ * Prints the stats of a test run to the console.
12130
+ */
12131
+ function result(passed: number, failed: number, skipped: number, duration: number | string, failedHooks?: number): void;
12121
12132
  }
12122
12133
  /**
12123
12134
  * Pauses test execution and starts interactive shell