find-cypress-specs 1.29.1 → 1.29.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +15 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "find-cypress-specs",
3
- "version": "1.29.1",
3
+ "version": "1.29.3",
4
4
  "description": "Find Cypress spec files using the config settings",
5
5
  "main": "src",
6
6
  "files": [
package/src/index.js CHANGED
@@ -210,9 +210,23 @@ function getSpecs(options, type) {
210
210
 
211
211
  function findCypressSpecs(options, type = 'e2e') {
212
212
  debug('finding specs of type %s', type)
213
+ if (options.version) {
214
+ debug('Cypress version %s', options.version)
215
+ }
216
+
217
+ let cyVersion = options.version
218
+ if (typeof cyVersion !== 'string') {
219
+ if ('integrationFolder' in options) {
220
+ cyVersion = '9.0.0'
221
+ } else {
222
+ cyVersion = '10.0.0'
223
+ }
224
+ }
225
+ const [major] = cyVersion.split('.').map(Number)
226
+ debug('treating options as Cypress version %d', major)
213
227
 
214
228
  if (type === 'e2e') {
215
- if (options.e2e) {
229
+ if (major >= 10) {
216
230
  debug('config has "e2e" property, treating as Cypress v10+')
217
231
  const specs = findCypressSpecsV10(options, type)
218
232
  return specs