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

@applitools/test-server

Package Overview
Dependencies
Maintainers
36
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@applitools/test-server - npm Package Compare versions

Comparing version 1.1.31 to 1.2.0

1

dist/cli/proxy-server.js
#!/usr/bin/env node
"use strict";
const proxyServer = require('../proxy-server');
proxyServer();
#!/usr/bin/env node
"use strict";
const testServer = require('../test-server');

@@ -3,0 +4,0 @@ const { argv } = require('yargs').option('hbData', { corece: JSON.stringify });

2

dist/generate-certificate.js

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

return {
key: node_forge_1.default.pki.privateKeyToPem(keys.privateKey),
cert: node_forge_1.default.pki.certificateToPem(cert),
key: node_forge_1.default.pki.privateKeyToPem(keys.privateKey),
};
}
exports.generateCertificate = generateCertificate;

@@ -0,1 +1,2 @@

"use strict";
module.exports = (req, res, next) => {

@@ -2,0 +3,0 @@ if (req.query.checkCookie) {

@@ -0,1 +1,2 @@

"use strict";
exports.create = function ({ allowedUrls = [] }) {

@@ -2,0 +3,0 @@ return (req, res, next) => {

@@ -0,1 +1,2 @@

"use strict";
// this middleware causes smurfs.jpg to be served only twice - once for the page and once for dom snapshot

@@ -2,0 +3,0 @@ const servedCount = {};

@@ -0,1 +1,2 @@

"use strict";
const Handlebars = require('handlebars');

@@ -2,0 +3,0 @@ const { readFileSync } = require('fs');

@@ -0,1 +1,2 @@

"use strict";
module.exports = (req, res, next) => {

@@ -2,0 +3,0 @@ if (req.headers.token != '12345') {

@@ -0,1 +1,2 @@

"use strict";
// this middleware causes any request to be delayed for a configurable amount of time

@@ -2,0 +3,0 @@ module.exports = async (req, _res, next) => {

@@ -0,1 +1,2 @@

"use strict";
// this middleware causes /stream to be served without ever closing the connection

@@ -2,0 +3,0 @@ module.exports = (req, res, next) => {

@@ -0,1 +1,2 @@

"use strict";
// this middleware causes smurfs.jpg to be served only outside of the browser

@@ -2,0 +3,0 @@ module.exports = (req, res, next) => {

@@ -0,1 +1,2 @@

"use strict";
const express = require('express');

@@ -2,0 +3,0 @@ const body = require('body-parser');

@@ -32,5 +32,4 @@ "use strict";

const net = __importStar(require("net"));
async function makeProxyServer({ agentId = 'TestProxy', logger } = {}) {
var _a;
logger = (_a = logger === null || logger === void 0 ? void 0 : logger.extend({ label: 'proxy-server' })) !== null && _a !== void 0 ? _a : (0, logger_1.makeLogger)({ label: 'proxy-server' });
async function makeProxyServer({ agentId = 'TestProxy', logger: defaultLogger } = {}) {
const logger = (0, logger_1.makeLogger)({ logger: defaultLogger, format: { label: 'proxy-server' } });
const proxyServer = await makeServer();

@@ -96,4 +95,3 @@ proxyServer.on('request', (request, response) => {

async function makeServer(options) {
const secure = Boolean((options === null || options === void 0 ? void 0 : options.cert) && (options === null || options === void 0 ? void 0 : options.key));
const server = secure ? https.createServer(options) : http.createServer();
const server = (options === null || options === void 0 ? void 0 : options.cert) && (options === null || options === void 0 ? void 0 : options.key) ? https.createServer(options) : http.createServer();
return new Promise((resolve, reject) => {

@@ -100,0 +98,0 @@ server.listen(0);

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

else {
options = { port: args[0], host: utils.types.isString(args[1]) ? args[1] : 'localhost' };
options = { port: Number(args[0]), host: utils.types.isString(args[1]) ? args[1] : 'localhost' };
}

@@ -56,5 +56,5 @@ if (!validate(options)) {

}
return originalSocketConnect.call(this, ...args);
return originalSocketConnect.apply(this, args);
}
}
exports.restrictNetwork = restrictNetwork;

@@ -0,1 +1,2 @@

"use strict";
const path = require('path');

@@ -2,0 +3,0 @@ const utils = require('@applitools/utils');

{
"name": "@applitools/test-server",
"version": "1.1.31",
"version": "1.2.0",
"homepage": "https://github.com/applitools/eyes.sdk.javascript1#readme",

@@ -37,4 +37,4 @@ "bugs": {

"scripts": {
"lint": "eslint . --ext .js",
"build": "tsc",
"lint": "node ../../node_modules/.bin/eslint '**/*.ts'",
"build": "node ../../node_modules/.bin/tsc --project ./tsconfig.build.json",
"test:sanity": "#",

@@ -47,6 +47,5 @@ "deps": "bongo deps",

"dependencies": {
"@applitools/logger": "1.1.52",
"@applitools/utils": "1.3.35",
"@applitools/logger": "2.0.0",
"@applitools/utils": "1.3.36",
"body-parser": "1.20.0",
"chalk": "3.0.0",
"cookie-parser": "1.4.5",

@@ -56,3 +55,2 @@ "cors": "2.8.5",

"handlebars": "4.7.7",
"http-proxy": "1.18.1",
"morgan": "1.10.0",

@@ -64,14 +62,3 @@ "node-forge": "1.3.1",

"@applitools/bongo": "^3.0.3",
"@types/pem": "^1.9.6",
"@typescript-eslint/eslint-plugin": "^5.41.0",
"@typescript-eslint/parser": "^5.41.0",
"eslint": "^8.26.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-no-only-tests": "^3.1.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"mocha": "^8.1.3",
"prettier": "^2.7.1",
"ts-node": "^10.9.1",
"typescript": "^4.8.4"
"@types/node-forge": "^1.3.2"
},

@@ -78,0 +65,0 @@ "engines": {

@@ -1,7 +0,6 @@

/// <reference types="node" />
export declare function generateCertificate({ days }?: {
days?: number;
}): Promise<{
key: Buffer;
cert: Buffer;
key: string;
cert: string;
}>;
export function create({ allowedUrls }: {
allowedUrls?: any[];
allowedUrls?: any[] | undefined;
}): (req: any, res: any, next: any) => void;

@@ -6,7 +6,7 @@ /// <reference types="node" />

import * as https from 'https';
export declare type ProxyServerOptions = {
export type ProxyServerOptions = {
agentId?: string;
logger?: Logger;
};
export declare function makeProxyServer({ agentId, logger }?: ProxyServerOptions): Promise<{
export declare function makeProxyServer({ agentId, logger: defaultLogger }?: ProxyServerOptions): Promise<{
server: https.Server<typeof http.IncomingMessage, typeof http.ServerResponse>;

@@ -13,0 +13,0 @@ port: number;

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