Skip to content

Commit 443bcc1

Browse files
committed
fix version in plugin
1 parent 8d0f1ee commit 443bcc1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

plugin.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ let usersCypress, env, host, webUrl, cdnUrl, debugFolderPath;
1919
const sessionId = uuidv4();
2020

2121
try {
22-
const packageFile = fs.readFileSync(path.resolve(path.dirname(require.resolve('cypress', {paths: [cwd]})), 'package.json'));
22+
let file = path.dirname(require.resolve('cypress', {paths: [cwd]}))
23+
if (file.endsWith("dist")) file = path.resolve(file, '..'); // in cypress 15+ resolve paths to dist folder
24+
packageFile = fs.readFileSync(path.resolve(file, 'package.json'));
2325
usersCypress = JSON.parse(packageFile.toString());
2426
if (!usersCypress.version) {
2527
usersCypress.version = "10.0.0.failure";

0 commit comments

Comments
 (0)