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

clarity-cli

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clarity-cli - npm Package Compare versions

Comparing version 1.0.16 to 1.0.17

2

package.json
{
"name": "clarity-cli",
"version": "1.0.16",
"version": "1.0.17",
"description": "Clarity setup for vscode.",

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

@@ -26,48 +26,70 @@ var fs = require("fs-extra");

fs.readdir(testDirectory).then((files) => {
files.forEach((file) => {
if (path.extname(file) === ".js") {
fs.readdir(testDirectory).catch(() => {
console.log(`Couldn't find test folder here: ${testDirectory}`);
return [];
}).then((files) => {
return files.reduce((promise, file) => {
var tests = require(path.join(testDirectory, file));
var defaultModules = tests.default || tests;
return promise.then(() => {
if (path.extname(file) === ".js") {
var prepare = promisify(defaultModules.prepare);
var destroy = promisify(defaultModules.destroy);
var clean = promisify(defaultModules.clean);
var tests = require(path.join(testDirectory, file));
var defaultModules = tests.default || tests;
Object.keys(defaultModules).filter((testName) => {
return specialTestNames[testName] == null;
}).reduce((promise, testName) => {
if (typeof defaultModules[testName] !== "function") {
return Promise.resolve("UNEXPECTED EXPORT: This export '" + testName + "' needs to be a function.");
}
return promise.then(() => {
try {
let result = defaultModules[testName]();
result = result instanceof Promise ? result : Promise.resolve(result);
var prepare = promisify(defaultModules.prepare);
var destroy = promisify(defaultModules.destroy);
var clean = promisify(defaultModules.clean);
return result.then(() => {
console.log("PASSED: " + testName);
}).catch((error) => {
return Object.keys(defaultModules).filter((testName) => {
return specialTestNames[testName] == null;
}).reduce((promise, testName) => {
if (typeof defaultModules[testName] !== "function") {
return Promise.resolve("UNEXPECTED EXPORT: This export '" + testName + "' needs to be a function.");
}
return promise.then(() => {
try {
let result = defaultModules[testName]();
result = result instanceof Promise ? result : Promise.resolve(result);
return result.then(() => {
console.log("PASSED: " + testName);
}).catch((error) => {
console.log("FAILED: " + testName);
console.log(error);
});
} catch (error) {
console.log("FAILED: " + testName);
console.log(error);
});
} catch (error) {
console.log("FAILED: " + testName);
console.log(error);
return Promise.resolve(null);
}
return Promise.resolve(null);
}
}).then(() => {
return clean();
});
}, prepare()).catch((error) => {
console.log("UNEXPECTED FAILURE: Most likely an async error.");
}).then(() => {
return clean();
return destroy();
});
}, prepare()).catch((error) => {
console.log("UNEXPECTED FAILURE: Most likely an async error.");
}).then(() => {
return destroy();
});
}
});
}).catch(() => {
console.log(`Couldn't find test folder here: ${testDirectory}`);
}
return Promise.resolve();
});
}, Promise.resolve());
}).catch((error) => {
console.log("UNEXPECTED FAILURE: " + error.message);
});

@@ -26,48 +26,70 @@ var fs = require("fs-extra");

fs.readdir(testDirectory).then((files) => {
files.forEach((file) => {
if (path.extname(file) === ".js") {
fs.readdir(testDirectory).catch(() => {
console.log(`Couldn't find test folder here: ${testDirectory}`);
return [];
}).then((files) => {
return files.reduce((promise, file) => {
var tests = require(path.join(testDirectory, file));
var defaultModules = tests.default || tests;
return promise.then(() => {
if (path.extname(file) === ".js") {
var prepare = promisify(defaultModules.prepare);
var destroy = promisify(defaultModules.destroy);
var clean = promisify(defaultModules.clean);
var tests = require(path.join(testDirectory, file));
var defaultModules = tests.default || tests;
Object.keys(defaultModules).filter((testName) => {
return specialTestNames[testName] == null;
}).reduce((promise, testName) => {
if (typeof defaultModules[testName] !== "function") {
return Promise.resolve("UNEXPECTED EXPORT: This export '" + testName + "' needs to be a function.");
}
return promise.then(() => {
try {
let result = defaultModules[testName]();
result = result instanceof Promise ? result : Promise.resolve(result);
var prepare = promisify(defaultModules.prepare);
var destroy = promisify(defaultModules.destroy);
var clean = promisify(defaultModules.clean);
return result.then(() => {
console.log("PASSED: " + testName);
}).catch((error) => {
return Object.keys(defaultModules).filter((testName) => {
return specialTestNames[testName] == null;
}).reduce((promise, testName) => {
if (typeof defaultModules[testName] !== "function") {
return Promise.resolve("UNEXPECTED EXPORT: This export '" + testName + "' needs to be a function.");
}
return promise.then(() => {
try {
let result = defaultModules[testName]();
result = result instanceof Promise ? result : Promise.resolve(result);
return result.then(() => {
console.log("PASSED: " + testName);
}).catch((error) => {
console.log("FAILED: " + testName);
console.log(error);
});
} catch (error) {
console.log("FAILED: " + testName);
console.log(error);
});
} catch (error) {
console.log("FAILED: " + testName);
console.log(error);
return Promise.resolve(null);
}
return Promise.resolve(null);
}
}).then(() => {
return clean();
});
}, prepare()).catch((error) => {
console.log("UNEXPECTED FAILURE: Most likely an async error.");
}).then(() => {
return clean();
return destroy();
});
}, prepare()).catch((error) => {
console.log("UNEXPECTED FAILURE: Most likely an async error.");
}).then(() => {
return destroy();
});
}
});
}).catch(() => {
console.log(`Couldn't find test folder here: ${testDirectory}`);
}
return Promise.resolve();
});
}, Promise.resolve());
}).catch((error) => {
console.log("UNEXPECTED FAILURE: " + error.message);
});

@@ -26,48 +26,70 @@ var fs = require("fs-extra");

fs.readdir(testDirectory).then((files) => {
files.forEach((file) => {
if (path.extname(file) === ".js") {
fs.readdir(testDirectory).catch(() => {
console.log(`Couldn't find test folder here: ${testDirectory}`);
return [];
}).then((files) => {
return files.reduce((promise, file) => {
var tests = require(path.join(testDirectory, file));
var defaultModules = tests.default || tests;
return promise.then(() => {
if (path.extname(file) === ".js") {
var prepare = promisify(defaultModules.prepare);
var destroy = promisify(defaultModules.destroy);
var clean = promisify(defaultModules.clean);
var tests = require(path.join(testDirectory, file));
var defaultModules = tests.default || tests;
Object.keys(defaultModules).filter((testName) => {
return specialTestNames[testName] == null;
}).reduce((promise, testName) => {
if (typeof defaultModules[testName] !== "function") {
return Promise.resolve("UNEXPECTED EXPORT: This export '" + testName + "' needs to be a function.");
}
return promise.then(() => {
try {
let result = defaultModules[testName]();
result = result instanceof Promise ? result : Promise.resolve(result);
var prepare = promisify(defaultModules.prepare);
var destroy = promisify(defaultModules.destroy);
var clean = promisify(defaultModules.clean);
return result.then(() => {
console.log("PASSED: " + testName);
}).catch((error) => {
return Object.keys(defaultModules).filter((testName) => {
return specialTestNames[testName] == null;
}).reduce((promise, testName) => {
if (typeof defaultModules[testName] !== "function") {
return Promise.resolve("UNEXPECTED EXPORT: This export '" + testName + "' needs to be a function.");
}
return promise.then(() => {
try {
let result = defaultModules[testName]();
result = result instanceof Promise ? result : Promise.resolve(result);
return result.then(() => {
console.log("PASSED: " + testName);
}).catch((error) => {
console.log("FAILED: " + testName);
console.log(error);
});
} catch (error) {
console.log("FAILED: " + testName);
console.log(error);
});
} catch (error) {
console.log("FAILED: " + testName);
console.log(error);
return Promise.resolve(null);
}
return Promise.resolve(null);
}
}).then(() => {
return clean();
});
}, prepare()).catch((error) => {
console.log("UNEXPECTED FAILURE: Most likely an async error.");
}).then(() => {
return clean();
return destroy();
});
}, prepare()).catch((error) => {
console.log("UNEXPECTED FAILURE: Most likely an async error.");
}).then(() => {
return destroy();
});
}
});
}).catch(() => {
console.log(`Couldn't find test folder here: ${testDirectory}`);
}
return Promise.resolve();
});
}, Promise.resolve());
}).catch((error) => {
console.log("UNEXPECTED FAILURE: " + error.message);
});
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