Skip to content

Latest commit

 

History

History
19 lines (15 loc) · 694 Bytes

File metadata and controls

19 lines (15 loc) · 694 Bytes

use-babelrc

Transpiling specs using local .babelrc file

The cypress/integration/spec.js uses null coalescing operator ??, which needs a separate plugin for Babel to transpile it.

it('handles nullish operator', () => {
  const data = {
    person: {
      firstName: 'Joe'
    }
  }
  const name = data.person.firstName ?? 'Anonymous'
  expect(name).to.equal('Joe')
})

There is a local .babelrc file, and to make Cypress preprocessor use it, the cypress/plugins/index.js removes Babel presets from the default options.