New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

impunity

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

impunity - npm Package Compare versions

Comparing version
1.0.1
to
1.0.2
+1
-1
package.json
{
"name": "impunity",
"version": "1.0.1",
"version": "1.0.2",
"description": "js test runner that finds unit tests in any imported ES module",

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

@@ -56,7 +56,6 @@ import * as path from "path";

export default async function findTests(entryPoint, symbol, forceEsmDirs) {
entryPoint = path.resolve(entryPoint);
export default async function findTests(entryPoint, rootDir, symbol, forceEsmDirs) {
const entryPointUrl = `file://${entryPoint}`;
const forceEsmDirUrls = (forceEsmDirs || []).map(dir => `file://${path.resolve(dir)}`);
const projectDir = path.dirname(entryPoint);
const projectDir = path.dirname(rootDir);
const projectDirUrl = `file://${projectDir}/`;

@@ -63,0 +62,0 @@

@@ -6,2 +6,3 @@ import * as commander from "commander";

import runTests from "./runner.mjs";
import * as path from "path";

@@ -13,2 +14,3 @@ const args = commander.default;

.option('--symbol [symbol]', 'the function to look for in each file to return the tests object', "tests")
.option('--root-dir [dir]', 'the function to look for in each file to return the tests object')
.option('--force-esm-dirs [dirs...]', 'also assume .js files are ES modules in this directory')

@@ -18,3 +20,5 @@ .parse(process.argv);

async function main() {
const tests = await findTests(args.entryPoint, args.symbol, args.forceEsmDirs);
let entryPoint = path.resolve(args.entryPoint);
let rootDir = args.rootDir ? path.resolve(args.rootDir) : path.dirname(entryPoint);
const tests = await findTests(entryPoint, rootDir, args.symbol, args.forceEsmDirs);
const failures = await runTests(tests);

@@ -21,0 +25,0 @@ if (failures) {