Skip to content

Latest commit

 

History

History
 
 

use-babelrc

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

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.