Comparing version 3.4.0 to 3.4.1-beta.1
@@ -56,4 +56,5 @@ "use strict"; | ||
try { | ||
require('${path}'); | ||
require('${path}')('source', 'backup'); | ||
} catch (e) { | ||
console.error(e); | ||
} | ||
@@ -71,9 +72,9 @@ }()); | ||
test('should inject new code', _asyncToGenerator(function*() { | ||
expect((0, _js).instrumentCypressInit(nonPatchedFile, 'foo')).toEqual(result()); | ||
expect((0, _js).instrumentCypressInit(nonPatchedFile, 'foo', 'source', 'backup')).toEqual(result()); | ||
})); | ||
test('should replace existing code', _asyncToGenerator(function*() { | ||
expect((0, _js).instrumentCypressInit(patchedFile, 'foo')).toEqual(result()); | ||
expect((0, _js).instrumentCypressInit(patchedFile, 'foo', 'source', 'backup')).toEqual(result()); | ||
})); | ||
test('should inject new code for windows path', _asyncToGenerator(function*() { | ||
expect((0, _js).instrumentCypressInit(nonPatchedFile, 'C:\\Users\\Administrator\\Desktop\\node_modules\\cy2\\dist/injected.js')).toEqual(result((0, _path).normalizePath('C:\\Users\\Administrator\\Desktop\\node_modules\\cy2\\dist/injected.js'))); | ||
expect((0, _js).instrumentCypressInit(nonPatchedFile, 'C:\\Users\\Administrator\\Desktop\\node_modules\\cy2\\dist/injected.js', 'source', 'backup')).toEqual(result((0, _path).normalizePath('C:\\Users\\Administrator\\Desktop\\node_modules\\cy2\\dist/injected.js'))); | ||
})); |
@@ -67,2 +67,3 @@ "use strict"; | ||
console.log(`[${label}] Running cypress with API URL: ${process.env.CYPRESS_API_URL}`); | ||
yield lib.verify(); | ||
yield lib.patchServerInit(`${__dirname}/injected.js`); | ||
@@ -69,0 +70,0 @@ const childProcess = yield lib.run(); |
@@ -31,3 +31,5 @@ "use strict"; | ||
try { require('${normalizedPath}')("${entryPointPath}", "${backupPath}"); } | ||
catch (e) {} | ||
catch (e) { | ||
console.error(e); | ||
} | ||
}`; | ||
@@ -34,0 +36,0 @@ const injectedCode = `(${injectedFn})();`; |
@@ -22,1 +22,2 @@ import cp from 'child_process'; | ||
export declare function run(): Promise<cp.ChildProcess>; | ||
export declare function verify(): Promise<void>; |
@@ -8,2 +8,3 @@ "use strict"; | ||
exports.run = run; | ||
exports.verify = verify; | ||
var _childProcess = _interopRequireDefault(require("child_process")); | ||
@@ -105,1 +106,16 @@ var _fs = _interopRequireDefault(require("fs")); | ||
} | ||
function _verify() { | ||
_verify = _asyncToGenerator(function*() { | ||
const cliBinPath = yield (0, _binPath).getCypressCLIBinPath(); | ||
(0, _debug).debug('Verifying cypress from %s', cliBinPath); | ||
_childProcess.default.execFileSync(cliBinPath, [ | ||
'verify' | ||
], { | ||
stdio: 'pipe' | ||
}); | ||
}); | ||
return _verify.apply(this, arguments); | ||
} | ||
function verify() { | ||
return _verify.apply(this, arguments); | ||
} |
{ | ||
"name": "cy2", | ||
"version": "3.4.0", | ||
"version": "3.4.1-beta.1", | ||
"author": "Andrew Goldis", | ||
@@ -5,0 +5,0 @@ "main": "./dist", |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
49642
1191
2