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

uvu

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uvu - npm Package Compare versions

Comparing version 0.4.1 to 0.5.0-next.0

run/index.d.ts

24

bin.js
#!/usr/bin/env node
const sade = require('sade');
const parse = require('./parse');
const pkg = require('./package');
const { parse } = require('./parse');
const dimport = x => new Function(`return import(${ JSON.stringify(x) })`).call(0);
const hasImport = (() => {
try { new Function('import').call(0) }
catch (err) { return !/unexpected/i.test(err.message) }
})();
sade('uvu [dir] [pattern]')

@@ -17,13 +24,8 @@ .version(pkg.version)

let { suites } = await parse(dir, pattern, opts);
let { exec, QUEUE } = require('.');
// TODO: mjs vs js file
globalThis.UVU_DEFER = 1;
suites.forEach((x, idx) => {
globalThis.UVU_INDEX = idx;
QUEUE.push([x.name]);
require(x.file); // auto-add to queue
});
await exec(opts.bail);
if (hasImport) {
await dimport('uvu/run').then(m => m.run(suites, opts));
} else {
await require('uvu/run').run(suites, opts);
}
} catch (err) {

@@ -30,0 +32,0 @@ console.error(err.stack || err.message);

{
"name": "uvu",
"version": "0.4.1",
"version": "0.5.0-next.0",
"repository": "lukeed/uvu",

@@ -29,2 +29,6 @@ "description": "uvu is an extremely fast and lightweight test runner for Node.js and the browser",

"import": "./parse/index.mjs"
},
"./run": {
"require": "./run/index.js",
"import": "./run/index.mjs"
}

@@ -38,3 +42,4 @@ },

"diff",
"dist"
"dist",
"run"
],

@@ -63,3 +68,3 @@ "modes": {

"dequal": "^2.0.0",
"diff": "^4.0.2",
"diff": "^5.0.0",
"kleur": "^4.0.3",

@@ -66,0 +71,0 @@ "sade": "^1.7.3",

type Arrayable<T> = T[] | T;
interface Suite {
export interface Suite {
/** The relative file path */

@@ -10,3 +10,3 @@ name: string;

interface Options {
export interface Options {
cwd: string;

@@ -17,3 +17,3 @@ require: Arrayable<string>;

interface Argv {
export interface Argv {
dir: string;

@@ -24,4 +24,2 @@ suites: Suite[];

// TODO: named `parse` export
// TODO: export type interfaces
function parse(dir: string, pattern: string, opts?: Partial<Options>): Promise<Argv>;
export = parse;
export function parse(dir: string, pattern: string, opts?: Partial<Options>): Promise<Argv>;

@@ -7,10 +7,7 @@ const { resolve } = require('path');

function exists(dep) {
try {
return require.resolve(dep);
} catch (err) {
return false;
}
try { return require.resolve(dep) }
catch (err) { return false }
}
module.exports = async function (dir, pattern, opts = {}) {
async function parse(dir, pattern, opts = {}) {
if (pattern) pattern = toRegex(pattern);

@@ -41,1 +38,3 @@ else if (dir) pattern = /(((?:[^\/]*(?:\/|$))*)[\\\/])?\w+\.([mc]js|[jt]sx?)$/;

}
exports.parse = parse;

Sorry, the diff of this file is not supported yet

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