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

Cucumber multi-wp installs #101

Open
wants to merge 2 commits into
base: release/1.0.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/cypress-plugin/modifySpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ const path = require('path');
* @returns {String} - New spec file with added before block
*/
module.exports = (fileContents, version, source, target) => {
const re = /(?:\.([^.]+))?$/;

// Only parse the following files.
if (!['js', 'jsx', 'ts', 'tsx'].includes(re.exec(source)[0])) {
return fileContents;
}

const beforeBlock = esprima.parseScript(`
before(() => {
const path = require('path');
Expand Down