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

testcafe-legacy-api

Package Overview
Dependencies
Maintainers
8
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

testcafe-legacy-api - npm Package Compare versions

Comparing version 5.0.2 to 5.1.1

12

lib/compiler/index.js

@@ -35,3 +35,3 @@ "use strict";

const promisify_1 = __importDefault(require("../utils/promisify"));
var readFile = promisify_1.default(fs.readFile);
var readFile = (0, promisify_1.default)(fs.readFile);
function exists(filePath) {

@@ -86,3 +86,3 @@ return new pinkie_1.default(resolve => fs.exists(filePath, resolve));

var data = await readFile(cfgPath);
var cfg = JSON.parse(strip_bom_1.default(data));
var cfg = JSON.parse((0, strip_bom_1.default)(data));
CompilerAdapter._resolveConfigModules(cfg, dir);

@@ -114,3 +114,3 @@ cfgs.push(cfg);

if (dirCfg.baseUrl)
cfg.baseUrl = url_1.resolve(cfg.baseUrl, dirCfg.baseUrl);
cfg.baseUrl = (0, url_1.resolve)(cfg.baseUrl, dirCfg.baseUrl);
});

@@ -127,3 +127,3 @@ this.cache.configs[dirName] = cfg;

var msg = 'There are test compilation errors:\n';
msg += errs.map(err => ` * ${legacy_1.getErrMsg(err)}`).join('\n');
msg += errs.map(err => ` * ${(0, legacy_1.getErrMsg)(err)}`).join('\n');
reject(new Error(msg));

@@ -140,3 +140,3 @@ }

path: filePath,
pageUrl: url_1.resolve(baseUrl, compiled.page),
pageUrl: (0, url_1.resolve)(baseUrl, compiled.page),
authCredentials: compiled.authCredentials,

@@ -172,3 +172,3 @@ getSharedJs: () => this.cache.requireJsMap[requireJsMapKey] + remainderJs

//(see: B237609 - Fixture file compiler memory overuse)
var hash = crypto_1.createHash('md5');
var hash = (0, crypto_1.createHash)('md5');
var requireJsMap = this.cache.requireJsMap;

@@ -175,0 +175,0 @@ var remainderJs = compiled.remainderJs;

@@ -0,0 +0,0 @@ "use strict";

@@ -32,7 +32,7 @@ "use strict";

const promisify_1 = __importDefault(require("../../utils/promisify"));
var readFile = promisify_1.default(fs_1.default.readFile);
var readFile = (0, promisify_1.default)(fs_1.default.readFile);
function construct(fileName, ownerFilename, callback) {
readFile(fileName)
.then(data => {
data = strip_bom_1.default(data);
data = (0, strip_bom_1.default)(data);
var constructed = null;

@@ -39,0 +39,0 @@ try {

@@ -0,0 +0,0 @@ exports.DIRECTIVE_EXPRESSION_AST_PATH = [

@@ -39,3 +39,3 @@ "use strict";

const promisify_1 = __importDefault(require("../../utils/promisify"));
var readFile = promisify_1.default(fs_1.default.readFile);
var readFile = (0, promisify_1.default)(fs_1.default.readFile);
//Util

@@ -355,3 +355,3 @@ //NOTE: this is a version of splice which can operate with array of the injectable items

.then(data => {
data = strip_bom_1.default(data);
data = (0, strip_bom_1.default)(data);
var ast = compiler._parseExternalTestCases(data);

@@ -358,0 +358,0 @@ compiler._validateTestCaseListAst(ast, testCasesPath);

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ exports.READ_FILE_FAILED = 'FIXTURE_CODE__READ_FILE_FAILED';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

@@ -40,3 +40,3 @@ "use strict";

this.descriptorsCache[require] = descriptor;
array_remove_1.default(this.readings, require);
(0, array_remove_1.default)(this.readings, require);
resolve({ errs, descriptor });

@@ -43,0 +43,0 @@ if (this.waiters[require]) {

@@ -0,0 +0,0 @@ var jsp = require("./parse-js"), pro = require("./process");

@@ -0,0 +0,0 @@ /***********************************************************************

@@ -0,0 +0,0 @@ var jsp = require("./parse-js"), pro = require("./process"), slice = jsp.slice, member = jsp.member, curry = jsp.curry, MAP = pro.MAP, PRECEDENCE = jsp.PRECEDENCE, OPERATORS = jsp.OPERATORS;

@@ -16,3 +16,3 @@ "use strict";

exports.TestRunErrorFormattableAdapter = formattable_adapter_1.default;
const CLIENT_RUNNER_SCRIPT = read_file_relative_1.readSync('./client/index.js');
const CLIENT_RUNNER_SCRIPT = (0, read_file_relative_1.readSync)('./client/index.js');
exports.CLIENT_RUNNER_SCRIPT = CLIENT_RUNNER_SCRIPT;

@@ -0,0 +0,0 @@ "use strict";

@@ -19,3 +19,3 @@ "use strict";

maxStringLength -= arrayIndexStr.length;
var diff = object_1.default(err, maxStringLength);
var diff = (0, object_1.default)(err, maxStringLength);
addDiffIndexPrefix(diff, arrayIndexStr);

@@ -22,0 +22,0 @@ return diff;

@@ -8,3 +8,3 @@ "use strict";

function formatDateTime(date) {
return moment_1.default(date).format('ddd MMM DD YYYY hh:mm:ss.SSS [GMT]ZZ');
return (0, moment_1.default)(date).format('ddd MMM DD YYYY hh:mm:ss.SSS [GMT]ZZ');
}

@@ -11,0 +11,0 @@ function getDatesDiff(err) {

@@ -13,11 +13,11 @@ "use strict";

if (err.isArrays)
return array_1.default(err, maxStringLength);
return (0, array_1.default)(err, maxStringLength);
if (err.isObjects)
return object_1.default(err, maxStringLength);
return (0, object_1.default)(err, maxStringLength);
if (err.isStrings)
return string_1.default(err, maxStringLength);
return (0, string_1.default)(err, maxStringLength);
if (err.isDates)
return date_1.default(err);
return truncate_diff_1.default(err, maxStringLength);
return (0, date_1.default)(err);
return (0, truncate_diff_1.default)(err, maxStringLength);
}
exports.default = buildDiff;

@@ -11,7 +11,7 @@ "use strict";

if (err.diffType && err.diffType.isDates)
return date_1.default(err);
return (0, date_1.default)(err);
if (err.diffType && err.diffType.isStrings)
return string_1.default(err, maxStringLength);
return truncate_diff_1.default(err, maxStringLength);
return (0, string_1.default)(err, maxStringLength);
return (0, truncate_diff_1.default)(err, maxStringLength);
}
exports.default = getObjectsDiff;

@@ -0,0 +0,0 @@ "use strict";

@@ -12,3 +12,3 @@ "use strict";

var renderer = ['string', 'punctuator', 'keyword', 'number', 'regex', 'comment', 'invalid'].reduce((syntaxRenderer, tokenType) => {
syntaxRenderer[tokenType] = str => `<span class="syntax-${tokenType}">${lodash_1.escape(str)}</span>`;
syntaxRenderer[tokenType] = str => `<span class="syntax-${tokenType}">${(0, lodash_1.escape)(str)}</span>`;
return syntaxRenderer;

@@ -22,7 +22,7 @@ }, {});

this.testRunState = metaInfo.testRunState;
lodash_1.assignIn(this, err);
(0, lodash_1.assignIn)(this, err);
this.callsite = this.callsite || metaInfo.callsite;
}
static _getSelector(node) {
var classAttr = lodash_1.find(node.attrs, { name: 'class' });
var classAttr = (0, lodash_1.find)(node.attrs, { name: 'class' });
var cls = classAttr && classAttr.value;

@@ -54,3 +54,3 @@ return cls ? `${node.tagName} ${cls}` : node.tagName;

return null;
var code = highlight_es_1.default(this.callsite, renderer);
var code = (0, highlight_es_1.default)(this.callsite, renderer);
var lines = code.split(NEWLINE);

@@ -57,0 +57,0 @@ var lastLine = lines.pop();

@@ -11,6 +11,6 @@ "use strict";

function escapeNewLines(str) {
return lodash_1.escape(str).replace(/(\r\n|\n|\r)/gm, '\\n');
return (0, lodash_1.escape)(str).replace(/(\r\n|\n|\r)/gm, '\\n');
}
function getAssertionMsgPrefix(err) {
return err.message ? `"${lodash_1.escape(err.message)}" assertion` : 'Assertion';
return err.message ? `"${(0, lodash_1.escape)(err.message)}" assertion` : 'Assertion';
}

@@ -21,3 +21,3 @@ function getDiffHeader(err) {

if (err.isObjects)
return `Objects differ at the <code>${lodash_1.escape(err.key)}</code> field:`;
return `Objects differ at the <code>${(0, lodash_1.escape)(err.key)}</code> field:`;
if (err.isStrings)

@@ -28,4 +28,4 @@ return `Strings differ at index <code>${err.key}</code>:`;

function markup(err, msgMarkup, opts = {}) {
msgMarkup = dedent_1.default(`
<div class="message">${dedent_1.default(msgMarkup)}</div>
msgMarkup = (0, dedent_1.default)(`
<div class="message">${(0, dedent_1.default)(msgMarkup)}</div>

@@ -35,3 +35,3 @@ <strong>Browser:</strong> <span class="user-agent">${err.userAgent}</span>

if (err.screenshotPath)
msgMarkup += `\n<div class="screenshot-info"><strong>Screenshot:</strong> <a class="screenshot-path">${lodash_1.escape(err.screenshotPath)}</a></div>`;
msgMarkup += `\n<div class="screenshot-info"><strong>Screenshot:</strong> <a class="screenshot-path">${(0, lodash_1.escape)(err.screenshotPath)}</a></div>`;
if (!opts.withoutCallsite) {

@@ -46,3 +46,3 @@ var callsiteMarkup = err.getCallsiteMarkup();

[type_1.default.okAssertion]: err => markup(err, `
${getAssertionMsgPrefix(err)} failed at step "${lodash_1.escape(err.stepName)}":
${getAssertionMsgPrefix(err)} failed at step "${(0, lodash_1.escape)(err.stepName)}":

@@ -53,3 +53,3 @@ <strong>Expected: </strong>not <code>null</code>, not <code>undefined</code>, not <code>false</code>, not <code>NaN</code> and not <code>''</code>

[type_1.default.notOkAssertion]: err => markup(err, `
${getAssertionMsgPrefix(err)} failed at step "${lodash_1.escape(err.stepName)}":
${getAssertionMsgPrefix(err)} failed at step "${(0, lodash_1.escape)(err.stepName)}":

@@ -60,6 +60,6 @@ <strong>Expected: </strong><code>null</code>, <code>undefined</code>, <code>false</code>, <code>NaN</code> or <code>''</code>

[type_1.default.eqAssertion]: (err, maxStringLength) => {
var diff = assertion_diffs_1.default(err, maxStringLength);
var diff = (0, assertion_diffs_1.default)(err, maxStringLength);
var diffMarkerStr = diff.marker ? ` ${diff.marker}` : '';
return markup(err, `
${getAssertionMsgPrefix(err)} failed at step "${lodash_1.escape(err.stepName)}":
${getAssertionMsgPrefix(err)} failed at step "${(0, lodash_1.escape)(err.stepName)}":

@@ -74,3 +74,3 @@ ${getDiffHeader(err)}

[type_1.default.notEqAssertion]: err => markup(err, `
${getAssertionMsgPrefix(err)} failed at step "${lodash_1.escape(err.stepName)}":
${getAssertionMsgPrefix(err)} failed at step "${(0, lodash_1.escape)(err.stepName)}":

@@ -84,3 +84,3 @@ <strong>Expected: </strong>not <code>${escapeNewLines(err.actual)}</code>

[type_1.default.inIFrameTargetLoadingTimeout]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Error at step "${(0, lodash_1.escape)(err.stepName)}":
IFrame target loading timed out.

@@ -91,19 +91,19 @@ `),

return markup(err, `
Uncaught JavaScript error <code>${lodash_1.escape(err.scriptErr)}</code> on page <a href="${err.pageDestUrl}">${err.pageDestUrl}</a>
Uncaught JavaScript error <code>${(0, lodash_1.escape)(err.scriptErr)}</code> on page <a href="${err.pageDestUrl}">${err.pageDestUrl}</a>
`);
}
return markup(err, `
Uncaught JavaScript error <code>${lodash_1.escape(err.scriptErr)}</code> on page.
Uncaught JavaScript error <code>${(0, lodash_1.escape)(err.scriptErr)}</code> on page.
`);
},
[type_1.default.uncaughtJSErrorInTestCodeStep]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Uncaught JavaScript error in test code - <code>${lodash_1.escape(err.scriptErr)}</code>.
Error at step "${(0, lodash_1.escape)(err.stepName)}":
Uncaught JavaScript error in test code - <code>${(0, lodash_1.escape)(err.scriptErr)}</code>.
`),
[type_1.default.storeDomNodeOrJqueryObject]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Error at step "${(0, lodash_1.escape)(err.stepName)}":
It is not allowed to share the DOM element, jQuery object or a function between test steps via "this" object.
`),
[type_1.default.emptyFirstArgument]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Error at step "${(0, lodash_1.escape)(err.stepName)}":
A target element of the <code>${err.action}</code> action has not been found in the DOM tree.

@@ -113,86 +113,86 @@ If this element should be created after animation or a time-consuming operation is finished, use the <code>waitFor</code> action (available for use in code) to pause test execution until this element appears.

[type_1.default.invisibleActionElement]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
A target element <code>${lodash_1.escape(err.element)}</code> of the <code>${err.action}</code> action is not visible.
Error at step "${(0, lodash_1.escape)(err.stepName)}":
A target element <code>${(0, lodash_1.escape)(err.element)}</code> of the <code>${err.action}</code> action is not visible.
If this element should appear when you are hovering over another element, make sure that you properly recorded the <code>hover</code> action.
`),
[type_1.default.incorrectDraggingSecondArgument]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Error at step "${(0, lodash_1.escape)(err.stepName)}":
<code>drag</code> action drop target is incorrect.
`),
[type_1.default.incorrectPressActionArgument]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Error at step "${(0, lodash_1.escape)(err.stepName)}":
<code>press</code> action parameter contains incorrect key code.
`),
[type_1.default.emptyTypeActionArgument]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Error at step "${(0, lodash_1.escape)(err.stepName)}":
The <code>type<code> action's parameter text is empty.
`),
[type_1.default.unexpectedDialog]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Unexpected system <code>${err.dialog}</code> dialog <code>${lodash_1.escape(err.message)}</code> appeared.
Error at step "${(0, lodash_1.escape)(err.stepName)}":
Unexpected system <code>${err.dialog}</code> dialog <code>${(0, lodash_1.escape)(err.message)}</code> appeared.
`),
[type_1.default.expectedDialogDoesntAppear]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Error at step "${(0, lodash_1.escape)(err.stepName)}":
The expected system <code>${err.dialog}</code> dialog did not appear.
`),
[type_1.default.incorrectSelectActionArguments]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Error at step "${(0, lodash_1.escape)(err.stepName)}":
<code>select</code> action's parameters contain an incorrect value.
`),
[type_1.default.incorrectWaitActionMillisecondsArgument]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Error at step "${(0, lodash_1.escape)(err.stepName)}":
<code>wait</code> action's "milliseconds" parameter should be a positive number.
`),
[type_1.default.incorrectWaitForActionEventArgument]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Error at step "${(0, lodash_1.escape)(err.stepName)}":
<code>waitFor</code> action's first parameter should be a function, a CSS selector or an array of CSS selectors.
`),
[type_1.default.incorrectWaitForActionTimeoutArgument]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Error at step "${(0, lodash_1.escape)(err.stepName)}":
<code>waitFor</code> action's "timeout" parameter should be a positive number.
`),
[type_1.default.waitForActionTimeoutExceeded]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Error at step "${(0, lodash_1.escape)(err.stepName)}":
<code>waitFor</code> action's timeout exceeded.
`),
[type_1.default.incorrectGlobalWaitForActionEventArgument]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Error at step "${(0, lodash_1.escape)(err.stepName)}":
<code>__waitFor</code> action's first parameter should be a function.
`),
[type_1.default.incorrectGlobalWaitForActionTimeoutArgument]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Error at step "${(0, lodash_1.escape)(err.stepName)}":
<code>__waitFor</code> action's "timeout" parameter should be a positive number.
`),
[type_1.default.globalWaitForActionTimeoutExceeded]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Error at step "${(0, lodash_1.escape)(err.stepName)}":
<code>__waitFor</code> action's timeout exceeded.
`),
[type_1.default.emptyIFrameArgument]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Error at step "${(0, lodash_1.escape)(err.stepName)}":
The selector within the <code>inIFrame</code> function returns an empty value.
`),
[type_1.default.iframeArgumentIsNotIFrame]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Error at step "${(0, lodash_1.escape)(err.stepName)}":
The selector within the <code>inIFrame</code> function doesn’t return an iframe element.
`),
[type_1.default.multipleIFrameArgument]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Error at step "${(0, lodash_1.escape)(err.stepName)}":
The selector within the <code>inIFrame</code> function returns more than one iframe element.
`),
[type_1.default.incorrectIFrameArgument]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Error at step "${(0, lodash_1.escape)(err.stepName)}":
The <code>inIFrame</code> function contains an invalid argument.
`),
[type_1.default.uploadCanNotFindFileToUpload]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Error at step "${(0, lodash_1.escape)(err.stepName)}":
Cannot find the following file(s) to upload:
${err.filePaths.map(path => `<code>${lodash_1.escape(path)}</code>`).join(',\n')}
${err.filePaths.map(path => `<code>${(0, lodash_1.escape)(path)}</code>`).join(',\n')}
`),
[type_1.default.uploadElementIsNotFileInput]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Error at step "${(0, lodash_1.escape)(err.stepName)}":
<code>upload</code> action argument does not contain a file input element.
`),
[type_1.default.uploadInvalidFilePathArgument]: err => markup(err, `
Error at step "${lodash_1.escape(err.stepName)}":
Error at step "${(0, lodash_1.escape)(err.stepName)}":
<code>upload</code> action's "path" parameter should be a string or an array of strings.

@@ -199,0 +199,0 @@ `),

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

@@ -14,4 +14,4 @@ "use strict";

// Const
const TEST_RUN_TEMPLATE = read_file_relative_1.readSync('../client/test-run/index.js.mustache');
const IFRAME_TEST_RUN_TEMPLATE = read_file_relative_1.readSync('../client/test-run/iframe.js.mustache');
const TEST_RUN_TEMPLATE = (0, read_file_relative_1.readSync)('../client/test-run/index.js.mustache');
const IFRAME_TEST_RUN_TEMPLATE = (0, read_file_relative_1.readSync)('../client/test-run/iframe.js.mustache');
const ASYNC_SERVICE_MESSAGE_HANDLERS = [command_1.default.takeScreenshot, command_1.default.fatalError, command_1.default.assertionFailed, command_1.default.done];

@@ -18,0 +18,0 @@ class LegacyTestRun extends testcafe_hammerhead_1.Session {

@@ -0,0 +0,0 @@ "use strict";

@@ -9,4 +9,4 @@ "use strict";

function default_1(fn) {
return pify_1.default(fn, pinkie_1.default);
return (0, pify_1.default)(fn, pinkie_1.default);
}
exports.default = default_1;
{
"name": "testcafe-legacy-api",
"version": "5.0.2",
"version": "5.1.1",
"description": "Legacy API support for TestCafe",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -0,0 +0,0 @@ # testcafe-legacy-api

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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