find-cypress-specs 1.19.1 → 1.19.3

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-10.8.0-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-10.11.0-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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "find-cypress-specs",
3
- "version": "1.19.1",
3
+ "version": "1.19.3",
4
4
  "description": "Find Cypress spec files using the config settings",
5
5
  "main": "src",
6
6
  "files": [
@@ -40,7 +40,7 @@
40
40
  "homepage": "https://github.com/bahmutov/find-cypress-specs#readme",
41
41
  "devDependencies": {
42
42
  "ava": "^4.0.0",
43
- "cypress": "10.8.0",
43
+ "cypress": "10.11.0",
44
44
  "execa-wrap": "^1.4.0",
45
45
  "prettier": "^2.5.1",
46
46
  "really-need": "^1.9.2",
package/src/index.js CHANGED
@@ -36,6 +36,12 @@ function getConfigTs(filename) {
36
36
  const configFilename = path.join(process.cwd(), filename)
37
37
  debug('loading Cypress config from %s', configFilename)
38
38
  const definedConfig = requireEveryTime(configFilename)
39
+ if (definedConfig && definedConfig.default) {
40
+ // due to TS / ES6 module transpile we got the default export
41
+ debug('returning default export as config from %s', filename)
42
+ return definedConfig.default
43
+ }
44
+
39
45
  return definedConfig
40
46
  }
41
47
 
@@ -52,7 +58,7 @@ function getConfig() {
52
58
 
53
59
  if (fs.existsSync('./cypress.json')) {
54
60
  debug('found file cypress.json')
55
- return getConfigJson('./cypress.config.js')
61
+ return getConfigJson('./cypress.json')
56
62
  }
57
63
 
58
64
  throw new Error('Do not know how to find and load Cypress config file')
@@ -156,10 +162,12 @@ function getSpecs() {
156
162
 
157
163
  function findCypressSpecs(options) {
158
164
  if (options.e2e) {
165
+ debug('config has "e2e" property, treating as Cypress v10+')
159
166
  const specs = findCypressSpecsV10(options)
160
167
  return specs
161
168
  }
162
169
 
170
+ debug('reading Cypress config < v10')
163
171
  const specs = findCypressSpecsV9(options)
164
172
  return specs
165
173
  }