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

bft

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bft - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

5

bft.js

@@ -7,5 +7,2 @@ #! /usr/bin/env node

.map((x) => require('path').resolve(x))
.forEach((testfile) => {
process.stdout.write(`${testfile}\n`);
return require(testfile);
});
.forEach((testfile) => require(testfile));

2

index.d.ts

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

export function test(name: string, assertion?: Function | Promise<void>): Promise<void>;
export function test(description: string, assertion?: Function | Promise<void>): Promise<void>;
/**
* test function for `bft`
*
* @param {string} name - name of test
* @param {string} description - description of test
* @param {function|Promise<void>} [assertion] - test code
*/
module.exports.test = async (name, assertion = null) => {
module.exports.test = async (description, assertion = null) => {
const log = (txt) => {

@@ -12,12 +12,23 @@ return process.stdout.write(

? txt
.replace(/^PASSED/, '\x1b[32mPASSED\x1b[39m')
.replace(/^FAILED/, '\x1b[31mFAILED\x1b[39m')
.replace(/^SKIPPED/, '\x1b[2mSKIPPED\x1b[0m')
.replace(/^PASSED/, '\x1b[32mPASSED\x1b[0m')
.replace(/^FAILED/, '\x1b[31mFAILED\x1b[0m')
.replace(/^SKIPPED/, '\x1b[33mSKIPPED\x1b[0m')
: txt
);
};
const [, , caller] = new Error().stack.split('at ');
const [, filename] = caller.match(/\((.*)\)/);
const origin =
process.stdout.hasColors && process.stdout.hasColors() === true
? `\x1b[2m${filename}\x1b[0m`
: filename;
const name =
process.stdout.hasColors && process.stdout.hasColors() === true
? `\x1b[1m${description}\x1b[0m`
: description;
setImmediate(async () => {
try {
if (assertion === null) {
log(`SKIPPED\t${name}`);
log(`SKIPPED\t${name} << ${origin}`);
return;

@@ -29,5 +40,5 @@ }

log(`PASSED\t${name}`);
log(`PASSED\t${name} << ${origin}`);
} catch (err) {
log(`FAILED\t${name}`);
log(`FAILED\t${name} << ${origin}`);
const lines = err.stack

@@ -34,0 +45,0 @@ .split('\n')

{
"name": "bft",
"version": "1.0.2",
"version": "1.1.0",
"description": "bloat-free-testrunner",

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

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