find-cypress-specs 1.36.3 → 1.37.0

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # find-cypress-specs [![renovate-app badge][renovate-badge]][renovate-app] ![cypress version](https://img.shields.io/badge/cypress-13.3.1-brightgreen) [![ci](https://github.com/bahmutov/find-cypress-specs/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/bahmutov/find-cypress-specs/actions/workflows/ci.yml)
1
+ # find-cypress-specs [![renovate-app badge][renovate-badge]][renovate-app] ![cypress version](https://img.shields.io/badge/cypress-13.3.2-brightgreen) [![ci](https://github.com/bahmutov/find-cypress-specs/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/bahmutov/find-cypress-specs/actions/workflows/ci.yml)
2
2
 
3
3
  > Find Cypress spec files using the config settings
4
4
 
@@ -113,6 +113,14 @@ $ npx find-cypress-specs --branch main --tagged @user,@preview
113
113
  # and that have any tests or suites inside tagged "@user" or "@preview"
114
114
  ```
115
115
 
116
+ You can set the list and number of specs with tags into GHA outputs
117
+
118
+ ```bash
119
+ $ npx find-cypress-specs --branch main --tagged @user,@preview --set-gha-outputs
120
+ ```
121
+
122
+ The number of found specs will be set as `taggedSpecsN` and the list will be set as `taggedSpecs`.
123
+
116
124
  ### count tagged changed specs
117
125
 
118
126
  Let's say we changed 2 specs that have tests tagged `@user`. We can output the count by adding `--count` option
package/bin/find.js CHANGED
@@ -248,6 +248,14 @@ if (args['--test-counts']) {
248
248
  debug('printing the spec names list only')
249
249
  const specNames = specs.join(',')
250
250
  console.log(specNames)
251
+
252
+ if (args['--set-gha-outputs']) {
253
+ debug('setting GitHub Actions outputs taggedSpecsN and taggedSpecs')
254
+ debug('taggedSpecsN %d', specs.length)
255
+ debug('plus taggedSpecs')
256
+ core.setOutput('taggedSpecsN', specs.length)
257
+ core.setOutput('taggedSpecs', specNames)
258
+ }
251
259
  }
252
260
  }
253
261
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "find-cypress-specs",
3
- "version": "1.36.3",
3
+ "version": "1.37.0",
4
4
  "description": "Find Cypress spec files using the config settings",
5
5
  "main": "src",
6
6
  "files": [
@@ -53,7 +53,7 @@
53
53
  "homepage": "https://github.com/bahmutov/find-cypress-specs#readme",
54
54
  "devDependencies": {
55
55
  "ava": "^4.0.0",
56
- "cypress": "13.3.1",
56
+ "cypress": "13.3.2",
57
57
  "dependency-version-badge": "^1.11.0",
58
58
  "execa-wrap": "^1.4.0",
59
59
  "prettier": "^2.5.1",
package/src/index.js CHANGED
@@ -86,7 +86,7 @@ function getConfig() {
86
86
  throw new Error('Config file should be .ts, .js or .json file')
87
87
  }
88
88
 
89
- function findCypressSpecsV9(opts = {}) {
89
+ function findCypressSpecsV9(opts = {}, returnAbsolute = false) {
90
90
  const defaults = {
91
91
  integrationFolder: 'cypress/integration',
92
92
  testFiles: '**/*.{js,ts}',
@@ -103,6 +103,7 @@ function findCypressSpecsV9(opts = {}) {
103
103
  sort: true,
104
104
  cwd: options.integrationFolder,
105
105
  ignore: options.ignoreTestFiles,
106
+ absolute: returnAbsolute,
106
107
  })
107
108
  debug('found %d file(s) %o', files.length, files)
108
109
 
@@ -271,7 +272,7 @@ function findCypressSpecs(options, type = 'e2e', returnAbsolute = false) {
271
272
  }
272
273
 
273
274
  debug('reading Cypress config < v10')
274
- const specs = findCypressSpecsV9(options)
275
+ const specs = findCypressSpecsV9(options, returnAbsolute)
275
276
  return specs
276
277
  } else if (type === 'component') {
277
278
  debug('finding component specs')