- Linting (ESLint): Check eslintrc file itself
- Linting: Add linting plugins (mocha, chai-expect, chai-friendly, cypress) - Testing: Change cypress plugins file to ESM (so can set up any needed unit testing tasks)
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
/* globals module, require */
|
||||
/* eslint-disable import/no-commonjs */
|
||||
'use strict';
|
||||
|
||||
// ***********************************************************
|
||||
// This example plugins/index.js can be used to load plugins
|
||||
@@ -11,18 +10,7 @@
|
||||
// https://on.cypress.io/plugins-guide
|
||||
// ***********************************************************
|
||||
|
||||
// This function is called when a project is opened or re-opened (e.g. due to
|
||||
// the project's config changing)
|
||||
|
||||
const codeCoverageTask = require('@cypress/code-coverage/task.js');
|
||||
|
||||
module.exports = (on, config) => {
|
||||
// `on` is used to hook into various events Cypress emits
|
||||
// `config` is the resolved Cypress config
|
||||
|
||||
// `on` is used to hook into various events Cypress emits
|
||||
// `config` is the resolved Cypress config
|
||||
|
||||
// https://docs.cypress.io/guides/tooling/code-coverage.html#Install-the-plugin
|
||||
on('task', codeCoverageTask);
|
||||
};
|
||||
require('@babel/register')({
|
||||
plugins: ['@babel/plugin-transform-modules-commonjs']
|
||||
});
|
||||
module.exports = require('./main.js').default;
|
||||
|
||||
16
cypress/plugins/main.js
Normal file
16
cypress/plugins/main.js
Normal file
@@ -0,0 +1,16 @@
|
||||
// This function is called when a project is opened or re-opened (e.g. due to
|
||||
// the project's config changing)
|
||||
|
||||
import codeCoverageTask from '@cypress/code-coverage/task.js';
|
||||
|
||||
// eslint-disable-next-line import/no-anonymous-default-export
|
||||
export default (on, config) => {
|
||||
// `on` is used to hook into various events Cypress emits
|
||||
// `config` is the resolved Cypress config
|
||||
|
||||
// `on` is used to hook into various events Cypress emits
|
||||
// `config` is the resolved Cypress config
|
||||
|
||||
// https://docs.cypress.io/guides/tooling/code-coverage.html#Install-the-plugin
|
||||
on('task', codeCoverageTask);
|
||||
};
|
||||
Reference in New Issue
Block a user