New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

luna-testing

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

luna-testing - npm Package Compare versions

Comparing version 1.7.0 to 1.8.0

57

bin/luna.js
#!/usr/bin/env node
/* Luna v1.7.0 */
/* Luna v1.8.0 */
'use strict';

@@ -394,3 +394,3 @@

if (options.verbose) {
console.log(`🔌 Server started at ${chalk__default['default'].bold(`http://localhost:${options.port}`)}…`);
console.log(`🔌 Server started at ${chalk__default["default"].bold(`http://localhost:${options.port}`)}…`);
}

@@ -405,3 +405,3 @@ });

if (code === undefined) {
return chalk__default['default'].yellow('undefined');
return chalk__default["default"].yellow('undefined');
}

@@ -416,7 +416,7 @@

code = code.replace(operator, (match) => chalk__default['default'].magenta(match));
code = code.replace(constant, (match) => chalk__default['default'].yellow(match));
code = code.replace(operator, (match) => chalk__default["default"].magenta(match));
code = code.replace(constant, (match) => chalk__default["default"].yellow(match));
for (const stringName of strings) {
code = code.replace(stringName, chalk__default['default'].green(stringMap[stringName]));
code = code.replace(stringName, chalk__default["default"].green(stringMap[stringName]));
}

@@ -896,3 +896,3 @@

const failures = parseInt(messageBits[2], 10);
console.log(`${failures === 0 ? chalk__default['default'].green.bold('✔︎') : chalk__default['default'].red.bold('𝗫')} ${chalk__default['default'].gray(`[${testPath}]`)}`, messageBits[1]);
console.log(`${failures === 0 ? chalk__default["default"].green.bold('✔︎') : chalk__default["default"].red.bold('𝗫')} ${chalk__default["default"].gray(`[${testPath}]`)}`, messageBits[1]);
return false;

@@ -960,17 +960,2 @@ }

async function formatLog(msg) {
return new Promise((resolve, reject) => {
const text = msg._text;
if (text === puppeteerObjectText) {
const objectData = msg._args[0]._remoteObject.preview;
msg._args[0].jsonValue().then((val) => {
resolve([text, objectData.description, val]);
}).catch(() => {});
return;
}
resolve(text);
});
}
async function runTestBrowser(browser, testPath, options) {

@@ -993,3 +978,3 @@ return new Promise(async(resolve, reject) => {

page.on('console', async(msg) => {
const newMsg = await formatLog(msg);
const newMsg = msg.text();
const resp = handleMessage(newMsg, testPath, options);

@@ -1058,3 +1043,3 @@ if (resp) {

if (message) {
console.log(`⚠️ ${chalk__default['default'].bold(message)}`);
console.log(`⚠️ ${chalk__default["default"].bold(message)}`);
}

@@ -1069,4 +1054,4 @@ process.exit(1);

const indent = spaces(4);
console.log(`\n${chalk__default['default'].yellow(formatLine(lineNumber - 1, lineWidth))}`);
console.log(`${chalk__default['default'].yellow(formatLine(lineNumber, lineWidth))} ${indent}${syntaxHighlight(testData.source.code)}`);
console.log(`\n${chalk__default["default"].yellow(formatLine(lineNumber - 1, lineWidth))}`);
console.log(`${chalk__default["default"].yellow(formatLine(lineNumber, lineWidth))} ${indent}${syntaxHighlight(testData.source.code)}`);
let leftIndex = testData.left.range[0];

@@ -1090,5 +1075,5 @@

if (leftIndex > -1) {
console.log(`${chalk__default['default'].yellow(formatLine(lineNumber + 1, lineWidth))} ${indent}${spaces(leftIndex)}${chalk__default['default'].gray('|')}${rightIndex > -1 ? spaces(rightIndex - leftIndex - 1) + chalk__default['default'].gray('|') : ''}`);
console.log(`${chalk__default["default"].yellow(formatLine(lineNumber + 1, lineWidth))} ${indent}${spaces(leftIndex)}${chalk__default["default"].gray('|')}${rightIndex > -1 ? spaces(rightIndex - leftIndex - 1) + chalk__default["default"].gray('|') : ''}`);
if (rightIndex > -1) {
console.log(`${spaces(lineWidth)} ${indent}${spaces(leftIndex)}${chalk__default['default'].gray('|')}${rightIndex > -1 ? spaces(rightIndex - leftIndex - 1) + syntaxHighlight(JSON.stringify(testData.right.value)) : ''}`);
console.log(`${spaces(lineWidth)} ${indent}${spaces(leftIndex)}${chalk__default["default"].gray('|')}${rightIndex > -1 ? spaces(rightIndex - leftIndex - 1) + syntaxHighlight(JSON.stringify(testData.right.value)) : ''}`);
}

@@ -1100,8 +1085,8 @@ console.log(`${spaces(lineWidth)} ${indent}${spaces(leftIndex)}${syntaxHighlight(JSON.stringify(testData.left.value))}\n`);

function logError(error, options) {
console.log(`\n${chalk__default['default'].bold.underline(error.name)}\n`);
console.log(`\n${chalk__default["default"].bold.underline(error.name)}\n`);
if (error.type === 'taskerror') {
console.log(`⚠️ ${chalk__default['default'].red(error.data)}\n`);
console.log(`⚠️ ${chalk__default["default"].red(error.data)}\n`);
if (!options.node) {
console.log(`❓ Perhaps you meant to run your tests in node using the ${chalk__default['default'].bold('--node')} flag\n`);
console.log(`❓ Perhaps you meant to run your tests in node using the ${chalk__default["default"].bold('--node')} flag\n`);
}

@@ -1116,3 +1101,3 @@ return;

console.log(`❌ ${chalk__default['default'].red.bold(test.name)}`);
console.log(`❌ ${chalk__default["default"].red.bold(test.name)}`);
if (test.data) {

@@ -1179,3 +1164,3 @@ logAssertion(test.data);

console.log(chalk__default['default'].bold.underline.blue('Console Logs\n'));
console.log(chalk__default["default"].bold.underline.blue('Console Logs\n'));
for (const log of logs) {

@@ -1232,3 +1217,3 @@ if (typeof log === 'object' && log.constructor.name === 'Array' && log[0] === puppeteerObjectText) {

console.log(`\n💾 HTML coverage report available at ${chalk__default['default'].bold.underline('coverage/lcov-report/index.html')}`);
console.log(`\n💾 HTML coverage report available at ${chalk__default["default"].bold.underline('coverage/lcov-report/index.html')}`);
}

@@ -1262,3 +1247,3 @@

if (!options.verbose) {
bar = new ProgressBar__default['default']('⏳ [:bar] :percent (:current/:total)', {
bar = new ProgressBar__default["default"]('⏳ [:bar] :percent (:current/:total)', {
total: totalTests,

@@ -1391,3 +1376,3 @@ width: 50,

if (message) {
console.log(`\n⚠️ ${chalk__default['default'].bold(message)}`);
console.log(`\n⚠️ ${chalk__default["default"].bold(message)}`);
}

@@ -1394,0 +1379,0 @@ }

{
"name": "luna-testing",
"version": "1.7.0",
"version": "1.8.0",
"description": "A simple, modern, opinionated unit testing framework",

@@ -28,14 +28,14 @@ "homepage": "https://craig.is/testing/code",

"dependencies": {
"chalk": "^4.1.1",
"ci-info": "^3.1.1",
"chalk": "^4.1.2",
"ci-info": "^3.7.1",
"escodegen": "^2.0.0",
"eslint": "^7.25.0",
"eslint": "^8.31.0",
"esprima": "^4.0.1",
"express": "^4.17.1",
"istanbul-api": "^3.0.0",
"istanbul-lib-coverage": "^3.0.0",
"magic-string": "^0.25.7",
"istanbul-lib-coverage": "^3.2.0",
"magic-string": "^0.27.0",
"progress": "^2.0.3",
"puppeteer": "^9.0.0",
"rollup": "^2.45.2",
"puppeteer": "^19.5.2",
"rollup": "^2.79.1",
"rollup-plugin-buble": "^0.19.8",

@@ -46,8 +46,8 @@ "rollup-plugin-istanbul": "^3.0.0",

"rollup-plugin-svelte": "^7.1.0",
"source-map": "^0.7.3",
"source-map": "^0.7.4",
"svelte": "^3.37.0",
"v8-to-istanbul": "^2.1.0",
"walk": "^2.3.14",
"yargs": "^16.2.0"
"walk": "^2.3.15",
"yargs": "^17.6.2"
}
}

@@ -163,17 +163,2 @@ // This is the runner that runs from node.js to execute the tests

async function formatLog(msg) {
return new Promise((resolve, reject) => {
const text = msg._text;
if (text === puppeteerObjectText) {
const objectData = msg._args[0]._remoteObject.preview;
msg._args[0].jsonValue().then((val) => {
resolve([text, objectData.description, val]);
}).catch(() => {});
return;
}
resolve(text);
});
}
async function runTestBrowser(browser, testPath, options) {

@@ -196,3 +181,3 @@ return new Promise(async(resolve, reject) => {

page.on('console', async(msg) => {
const newMsg = await formatLog(msg);
const newMsg = msg.text();
const resp = handleMessage(newMsg, testPath, options);

@@ -199,0 +184,0 @@ if (resp) {

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