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

Update Cypress._ to use lodash instead of underscore #548

Closed
jennifer-shehane opened this issue Jun 30, 2017 · 2 comments
Closed

Update Cypress._ to use lodash instead of underscore #548

jennifer-shehane opened this issue Jun 30, 2017 · 2 comments
Labels
pkg/driver This is due to an issue in the packages/driver directory
Milestone

Comments

@jennifer-shehane
Copy link
Member

Current behavior:

Currently, Cypress automatically includes Underscore and exposes it as Cypress._. where you can call any valid Underscore method on Cypress._.

New behavior:

Cypress has updated our internal libraries including the driver to use lodash. It then seemed unnecessary to include both Underscore and lodash in order to maintain Cypress._ current use.

Also, since any library can be imported, the use of Cypress._ is not as essential as it once was.

If you want to continue using Underscore methods in your tests, you can include the following after npm install --save-dev underscore:

var _ = require('underscore')

it('calls an underscore method', function(){
  cy.request('https://jsonplaceholder.typicode.com/users').then(function(response){
    var ids = _.chain(response.body).pluck('id').first(3).value()
    expect(ids).to.deep.eq([1, 2, 3])
  })
})
@RandallKent
Copy link
Contributor

The code for this is done, but this has yet to be released. We'll update the issue and reference the changelog when it's released.

@brian-mann
Copy link
Member

Fixed in 0.20.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg/driver This is due to an issue in the packages/driver directory
Projects
None yet
Development

No branches or pull requests

3 participants