Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using an array of strings in ignoreTestFiles causes an error #4312

Closed
hvuong-sigma opened this issue May 24, 2019 · 2 comments

Comments

3 participants
@hvuong-sigma
Copy link

commented May 24, 2019

Current behavior:

Cannot set property '0' of undefined
TypeError: Cannot set property '0' of undefined
    at /Users/myUser/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Resources/app/packages/server/lib/config.js:280:37
    at arrayEach (/Users/myUser/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Resources/app/packages/server/node_modules/lodash/lodash.js:537:11)
    at Function.forEach (/Users/myUser/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Resources/app/packages/server/node_modules/lodash/lodash.js:9359:14)
    at setResolvedOn (/Users/myUser/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Resources/app/packages/server/lib/config.js:276:18)
    at /Users/myUser/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Resources/app/packages/server/lib/config.js:278:20
    at /Users/myUser/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Resources/app/packages/server/node_modules/lodash/lodash.js:4944:15
    at baseForOwn (/Users/myUser/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Resources/app/packages/server/node_modules/lodash/lodash.js:3001:24)
    at /Users/myUser/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Resources/app/packages/server/node_modules/lodash/lodash.js:4913:18
    at Function.forEach (/Users/myUser/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Resources/app/packages/server/node_modules/lodash/lodash.js:9359:14)
    at setResolvedOn (/Users/myUser/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Resources/app/packages/server/lib/config.js:276:18)
    at Object.updateWithPluginValues (/Users/myUser/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Resources/app/packages/server/lib/config.js:287:7)
    at /Users/myUser/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Resources/app/packages/server/lib/project.js:124:27
    at tryCatcher (/Users/myUser/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/myUser/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:510:31)
    at Promise._settlePromise (/Users/myUser/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/Users/myUser/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/Users/myUser/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:691:18)
    at Async._drainQueue (/Users/myUser/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/Users/myUser/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/Users/myUser/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:781:20)
    at tryOnImmediate (timers.js:743:5)
    at processImmediate [as _immediateCallback] (timers.js:714:5)

Desired behavior:

From the documentation:

A String or Array of glob patterns used to ignore test files that would otherwise be shown in your list of tests. Cypress uses minimatch with the options: {dot: true, matchBase: true}. We suggest using http://globtester.com to test what files would match.

ignoreTestFiles should accept an array of strings that are glob patterns and not return an error.

Steps to reproduce: (app code and test code)

  1. Create an environment file
  2. Add the following code to the environment file:
{
  "ignoreTestFiles": [
    "**/folder1/someTest.spec.js",
    "**/folder2/subfolder2/someOtherTest.spec.js"
  ]
}
  1. Run Cypress with the newly created environment file

Versions

Cypress 3.1.4
MacOS 10.14.5

@flotwig

This comment has been minimized.

Copy link
Member

commented May 24, 2019

Hey @hvuong-sigma, thanks for the report. #3880 will fix this error and will be out in the next bugfix release.

@cypress-bot

This comment has been minimized.

Copy link

commented Jun 27, 2019

Released in 3.3.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.