Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cypress-babel-esx-preprocessor

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cypress-babel-esx-preprocessor

Cypress plugin to allow you to use all proposals to the JavaScript language at Proposal stage or above by using babel-preset-stage-1 as well as all JavaScript that has been finalised in the ECMA standard by using babel-preset-env

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

cypress-babel-esx-preprocessor

Cypress plugin to allow you to use all proposals to the JavaScript language at Proposal stage or above by using babel-preset-stage-1 as well as all JavaScript that has been finalised in the ECMA standard by using babel-preset-env

This uses Cypress' default preprocessor under the hood (@cypress/browserify-preprocessor), adding the necessary configuration to use these babel presets

Most notably this allows use of object destructuring/object spread syntax in your Cypress spec files

Install

# npm
npm install cypress-babel-esx-preprocessor --save-dev

# yarn
yarn add cypress-babel-esx-preprocessor --dev

Usage

// cypress/plugins/index.js

const babelEsX = require('cypress-babel-esx-preprocessor');

module.exports = (on) => {
    on('file:preprocessor', babelEsX());
};

Pass in some additional babel presets/plugins:

// cypress/plugins/index.js

const babelEsX = require('cypress-babel-esx-preprocessor');

module.exports = (on) => {
    const babelOptions = {
        presets: ['babel-preset-react'],
        plugins: ['babel-plugin-lodash']
    };
    on('file:preprocessor', babelEsX(babelOptions));
};

Pass in options to @cypress/browserify-preprocessor:

// cypress/plugins/index.js

const babelEsX = require('cypress-babel-esx-preprocessor');
const browserify = require('@cypress/browserify-preprocessor')

module.exports = (on) => {
    const options = browserify.defaultOptions;
    options.extensions.push('ts', 'tsx');
    on('file:preprocessor', babelEsX(null, options));
};

Keywords

FAQs

Package last updated on 10 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc