Socket
Socket
Sign inDemoInstall

automutate-tests

Package Overview
Dependencies
32
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.1 to 0.3.2

4

lib/describeTests.js

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

while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {

@@ -21,0 +21,0 @@ case 0: case 1: t = op; break;

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

while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {

@@ -21,0 +21,0 @@ case 0: case 1: t = op; break;

import { IMutationsProviderFactory } from "./mutationsProviderFactory";
import { ITestCaseSettings } from "./testCase";
/**
* Settings to describe test cases, namely file names and CLI flag equivalents.
*/
export interface ITestDescriptionSettings extends ITestCaseSettings {
export interface ITestDescriptionSettings {
/**
* Whether to override the expected file content's with the actual results, instead of checking equality.
*/
accept?: boolean;
/**
* File name or file name generator for the mutation result.
*/
actual: string | ((original: string) => string);
/**
* File name or file name generator for what the mutation result should be.
*/
expected: string | ((original: string) => string);
/**
* Wildcard(s) of tests to run.
*/
includes?: RegExp[];
/**
* Endlines to normalize \r\n|\n to, if anything.
*/
normalizeEndlines?: string;
/**
* File name for the original file contents.
*/
original: string;
/**
* File name for the settings file.
*/
settings: string;
}

@@ -49,3 +72,3 @@ /**

*/
private runTest(hierarchy);
private runTest;
}

@@ -52,0 +75,0 @@ /**

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

while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {

@@ -117,4 +117,4 @@ case 0: case 1: t = op; break;

accept: settings.accept,
actual: path.join(casePath, settings.actual),
expected: path.join(casePath, settings.expected),
actual: path.join(casePath, getSettingsFile(settings.actual, settings.original)),
expected: path.join(casePath, getSettingsFile(settings.expected, settings.original)),
normalizeEndlines: settings.normalizeEndlines,

@@ -125,2 +125,7 @@ original: matches[0],

};
var getSettingsFile = function (filePath, original) {
return typeof filePath === "string"
? filePath
: filePath(original);
};
/**

@@ -127,0 +132,0 @@ * @param casesPath Path to the test cases.

{
"name": "automutate-tests",
"version": "0.3.1",
"version": "0.3.2",
"description": "Test harness for automutators.",

@@ -32,12 +32,12 @@ "main": "lib/index.js",

"@types/glob": "^7.1.1",
"@types/mocha": "^5.2.5",
"@types/mocha": "^5.2.6",
"@types/mz": "0.0.32",
"@types/node": "^10.12.18",
"tslint": "^5.12.0",
"typescript": "^3.2.2"
"@types/node": "^11.13.4",
"tslint": "^5.15.0",
"typescript": "^3.4.3"
},
"dependencies": {
"automutate": "^0.7.1",
"automutate": "^0.7.2",
"chai": "^4.2.0",
"chalk": "^2.4.1",
"chalk": "^2.4.2",
"glob": "^7.1.3",

@@ -44,0 +44,0 @@ "mz": "^2.7.0"

@@ -13,7 +13,37 @@ import chalk from "chalk";

*/
export interface ITestDescriptionSettings extends ITestCaseSettings {
export interface ITestDescriptionSettings {
/**
* Whether to override the expected file content's with the actual results, instead of checking equality.
*/
accept?: boolean;
/**
* File name or file name generator for the mutation result.
*/
actual: string | ((original: string) => string);
/**
* File name or file name generator for what the mutation result should be.
*/
expected: string | ((original: string) => string);
/**
* Wildcard(s) of tests to run.
*/
includes?: RegExp[];
/**
* Endlines to normalize \r\n|\n to, if anything.
*/
normalizeEndlines?: string;
/**
* File name for the original file contents.
*/
original: string;
/**
* File name for the settings file.
*/
settings: string;
}

@@ -106,4 +136,4 @@

accept: settings.accept,
actual: path.join(casePath, settings.actual),
expected: path.join(casePath, settings.expected),
actual: path.join(casePath, getSettingsFile(settings.actual, settings.original)),
expected: path.join(casePath, getSettingsFile(settings.expected, settings.original)),
normalizeEndlines: settings.normalizeEndlines,

@@ -115,2 +145,7 @@ original: matches[0],

const getSettingsFile = (filePath: string | ((original: string) => string), original: string): string =>
typeof filePath === "string"
? filePath
: filePath(original);
/**

@@ -117,0 +152,0 @@ * @param casesPath Path to the test cases.

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 not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc