@bahmutov/cy-grep 1.9.16 → 1.9.17
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +14 -1
- package/package.json +5 -5
- package/src/plugin.js +11 -0
package/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# @bahmutov/cy-grep ![cypress version](https://img.shields.io/badge/cypress-12.
|
1
|
+
# @bahmutov/cy-grep ![cypress version](https://img.shields.io/badge/cypress-12.15.0-brightgreen)
|
2
2
|
|
3
3
|
> Filter tests using substring or tag
|
4
4
|
|
@@ -145,6 +145,19 @@ module.exports = defineConfig({
|
|
145
145
|
})
|
146
146
|
```
|
147
147
|
|
148
|
+
Trying to call the plugin function without any arguments or with more than a single argument throws an error
|
149
|
+
|
150
|
+
```js
|
151
|
+
// ERROR: forgot the config file
|
152
|
+
setupNodeEvents(on, config) {
|
153
|
+
require('@bahmutov/cy-grep/src/plugin')();
|
154
|
+
}
|
155
|
+
// ERROR: too many arguments
|
156
|
+
setupNodeEvents(on, config) {
|
157
|
+
require('@bahmutov/cy-grep/src/plugin')(on, config);
|
158
|
+
}
|
159
|
+
```
|
160
|
+
|
148
161
|
### Install in Cypress versions before 10
|
149
162
|
|
150
163
|
See [test-cy-v9](./test-cy-v9/) for example
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@bahmutov/cy-grep",
|
3
|
-
"version": "1.9.
|
3
|
+
"version": "1.9.17",
|
4
4
|
"description": "Filter Cypress tests using title or tags",
|
5
5
|
"main": "src/support.js",
|
6
6
|
"scripts": {
|
@@ -14,15 +14,15 @@
|
|
14
14
|
"dependencies": {
|
15
15
|
"cypress-plugin-config": "^1.2.0",
|
16
16
|
"debug": "^4.3.2",
|
17
|
-
"find-cypress-specs": "^1.
|
18
|
-
"find-test-names": "1.28.
|
17
|
+
"find-cypress-specs": "^1.35.1",
|
18
|
+
"find-test-names": "1.28.13"
|
19
19
|
},
|
20
20
|
"devDependencies": {
|
21
|
-
"cypress": "
|
21
|
+
"cypress": "13.1.0",
|
22
22
|
"cypress-each": "^1.11.0",
|
23
23
|
"cypress-expect": "^3.1.0",
|
24
24
|
"prettier": "^2.8.1",
|
25
|
-
"semantic-release": "^21.
|
25
|
+
"semantic-release": "^21.1.1",
|
26
26
|
"stop-only": "^3.3.1",
|
27
27
|
"typescript": "^4.7.4"
|
28
28
|
},
|
package/src/plugin.js
CHANGED
@@ -68,6 +68,17 @@ function getGrepSettings(config) {
|
|
68
68
|
* @param {Cypress.ConfigOptions} config
|
69
69
|
*/
|
70
70
|
function cypressGrepPlugin(config) {
|
71
|
+
if (arguments.length === 0) {
|
72
|
+
throw new Error(
|
73
|
+
'ERROR: forgot the config file, see https://github.com/bahmutov/cy-grep',
|
74
|
+
)
|
75
|
+
}
|
76
|
+
if (arguments.length > 1) {
|
77
|
+
throw new Error(
|
78
|
+
'ERROR: too many arguments, see https://github.com/bahmutov/cy-grep',
|
79
|
+
)
|
80
|
+
}
|
81
|
+
|
71
82
|
if (!config || !config.env) {
|
72
83
|
return config
|
73
84
|
}
|