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

ava

Package Overview
Dependencies
Maintainers
2
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ava - npm Package Compare versions

Comparing version 4.0.0-rc.1 to 4.0.0

9

lib/api.js

@@ -235,6 +235,9 @@ import fs from 'node:fs';

const providerStates = (await Promise.all(providers.map(async ({type, main}) => {
const providerStates = [];
await Promise.all(providers.map(async ({type, main}) => {
const state = await main.compile({cacheDir: this._createCacheDir(), files: testFiles});
return state === null ? null : {type, state};
}))).filter(state => state !== null);
if (state !== null) {
providerStates.push({type, state});
}
}));

@@ -241,0 +244,0 @@ // Resolve the correct concurrency value.

@@ -1,7 +0,6 @@

import chalk from 'chalk';
import {Chalk} from 'chalk'; // eslint-disable-line unicorn/import-style
let instance = new chalk.Instance(); // eslint-disable-line import/no-mutable-exports
export default instance;
let chalk = new Chalk(); // eslint-disable-line import/no-mutable-exports
export {instance as chalk};
export {chalk};

@@ -15,3 +14,3 @@ let configured = false;

configured = true;
instance = new chalk.Instance(options);
chalk = new Chalk(options);
}

@@ -90,3 +90,3 @@

coerce: coerceLastValue,
description: 'Enable verbose output (no-op)',
description: 'Enable verbose output (default)',
type: 'boolean',

@@ -235,3 +235,8 @@ },

const chalkOptions = {level: combined.color === false ? 0 : (await import('chalk')).level}; // eslint-disable-line node/no-unsupported-features/es-syntax
const chalkOptions = {level: 0};
if (combined.color !== false) {
const {supportsColor: {level}} = await import('chalk'); // eslint-disable-line node/no-unsupported-features/es-syntax, unicorn/import-style
chalkOptions.level = level;
}
const {set: setChalk} = await import('./chalk.js'); // eslint-disable-line node/no-unsupported-features/es-syntax

@@ -238,0 +243,0 @@ setChalk(chalkOptions);

@@ -5,3 +5,2 @@ import fs from 'node:fs';

import codeExcerpt from 'code-excerpt';
import equalLength from 'equal-length';

@@ -38,10 +37,5 @@ import {chalk} from './chalk.js';

const joinedLines = lines.map(line => line.value).join('\n');
const extendedLines = equalLength(joinedLines).split('\n');
const extendedWidth = Math.max(...lines.map(item => item.value.length));
return lines
.map((item, index) => ({
line: item.line,
value: extendedLines[index],
}))
.map(item => {

@@ -52,3 +46,3 @@ const isErrorSource = item.line === line;

const coloredLineNumber = isErrorSource ? lineNumber : chalk.grey(lineNumber);
const result = ` ${coloredLineNumber} ${item.value}`;
const result = ` ${coloredLineNumber} ${item.value.padEnd(extendedWidth)}`;

@@ -55,0 +49,0 @@ return isErrorSource ? chalk.bgRed(result) : result;

import {inspect} from 'node:util';
import ansiStyles from 'ansi-styles';
import {Chalk} from 'chalk'; // eslint-disable-line unicorn/import-style
import stripAnsi from 'strip-ansi';

@@ -8,3 +9,3 @@

const forceColor = new chalk.Instance({level: Math.max(chalk.level, 1)});
const forceColor = new Chalk({level: Math.max(chalk.level, 1)});

@@ -11,0 +12,0 @@ const colorTheme = {

@@ -7,3 +7,3 @@ import childProcess from 'node:child_process';

import Emittery from 'emittery';
import pEvent from 'p-event';
import {pEvent} from 'p-event';

@@ -10,0 +10,0 @@ import {controlFlow} from './ipc-flow-control.cjs';

@@ -7,9 +7,5 @@ import fs from 'node:fs';

import {
classify,
defaultIgnorePatterns,
hasExtension,
isHelperish,
matches,
normalizeFileForMatching,
normalizePattern,
normalizePatterns,

@@ -21,10 +17,10 @@ processMatchingPatterns,

classify,
isHelperish,
matches,
normalizePattern,
defaultIgnorePatterns,
hasExtension,
isHelperish,
matches,
normalizeFileForMatching,
normalizePattern,
normalizePatterns,
};
} from './glob-helpers.cjs';

@@ -125,7 +121,9 @@ const defaultIgnoredByWatcherPatterns = [

export async function findFiles({cwd, extensions, filePatterns}) {
return (await globFiles(cwd, filePatterns)).filter(file => hasExtension(extensions, file));
const files = await globFiles(cwd, filePatterns);
return files.filter(file => hasExtension(extensions, file));
}
export async function findTests({cwd, extensions, filePatterns}) {
return (await findFiles({cwd, extensions, filePatterns})).filter(file => !path.basename(file).startsWith('_'));
const files = await findFiles({cwd, extensions, filePatterns});
return files.filter(file => !path.basename(file).startsWith('_'));
}

@@ -132,0 +130,0 @@

@@ -89,8 +89,10 @@ import fs from 'node:fs';

do {
[{config: fileConf, fileForErrorMessage, configFile} = {config: NO_SUCH_FILE, fileForErrorMessage: undefined}, ...conflicting] = (await Promise.all([ // eslint-disable-line no-await-in-loop
const results = await Promise.all([ // eslint-disable-line no-await-in-loop
loadConfigFile({projectDir, configFile: path.join(searchDir, 'ava.config.js')}),
loadConfigFile({projectDir, configFile: path.join(searchDir, 'ava.config.cjs')}),
loadConfigFile({projectDir, configFile: path.join(searchDir, 'ava.config.mjs')}),
])).filter(result => result !== null);
]);
[{config: fileConf, fileForErrorMessage, configFile} = {config: NO_SUCH_FILE, fileForErrorMessage: undefined}, ...conflicting] = results.filter(result => result !== null);
searchDir = path.dirname(searchDir);

@@ -97,0 +99,0 @@ } while (fileConf === NO_SUCH_FILE && searchDir !== stopAt);

@@ -401,3 +401,5 @@ import {Buffer} from 'node:buffer';

return fileURLToPath(payload.sources[0]);
return payload.sources[0].startsWith('file://')
? fileURLToPath(payload.sources[0])
: payload.sources[0];
});

@@ -404,0 +406,0 @@

@@ -126,10 +126,10 @@ import {createRequire} from 'node:module';

const {projectDir, providerStates = []} = options;
const providers = (await Promise.all(providerStates.map(async ({type, state}) => {
const providers = [];
await Promise.all(providerStates.map(async ({type, state}) => {
if (type === 'typescript') {
return (await providerManager.typescript(projectDir)).worker({extensionsToLoadAsModules, state});
const provider = await providerManager.typescript(projectDir);
providers.push(provider.worker({extensionsToLoadAsModules, state}));
}
}));
return null;
}))).filter(provider => provider !== null);
const require = createRequire(import.meta.url);

@@ -136,0 +136,0 @@ const load = async ref => {

{
"name": "ava",
"version": "4.0.0-rc.1",
"version": "4.0.0",
"description": "Node.js test runner that lets you develop with confidence.",

@@ -73,3 +73,3 @@ "license": "MIT",

"dependencies": {
"acorn": "^8.5.0",
"acorn": "^8.7.0",
"acorn-walk": "^8.2.0",

@@ -80,7 +80,7 @@ "ansi-styles": "^6.1.0",

"callsites": "^4.0.0",
"cbor": "^8.0.2",
"chalk": "^4.1.2",
"cbor": "^8.1.0",
"chalk": "^5.0.0",
"chokidar": "^3.5.2",
"chunkd": "^2.0.1",
"ci-info": "^3.2.0",
"ci-info": "^3.3.0",
"ci-parallel-vars": "^1.0.1",

@@ -93,6 +93,5 @@ "clean-yaml-object": "^0.1.0",

"currently-unhandled": "^0.4.1",
"debug": "^4.3.2",
"debug": "^4.3.3",
"del": "^6.0.0",
"emittery": "^0.10.0",
"equal-length": "^1.0.1",
"figures": "^4.0.0",

@@ -108,11 +107,11 @@ "globby": "^12.0.2",

"ms": "^2.1.3",
"p-event": "^4.2.0",
"p-map": "^5.2.0",
"p-event": "^5.0.1",
"p-map": "^5.3.0",
"picomatch": "^2.3.0",
"pkg-conf": "^4.0.0",
"plur": "^4.0.0",
"plur": "^5.1.0",
"pretty-ms": "^7.0.1",
"resolve-cwd": "^3.0.0",
"slash": "^3.0.0",
"stack-utils": "^2.0.3",
"stack-utils": "^2.0.5",
"strip-ansi": "^7.0.1",

@@ -122,23 +121,23 @@ "supertap": "^2.0.0",

"write-file-atomic": "^3.0.3",
"yargs": "^17.2.1"
"yargs": "^17.3.1"
},
"devDependencies": {
"@ava/test": "github:avajs/test",
"@ava/typescript": "^2.0.0",
"@sinonjs/fake-timers": "^8.0.1",
"@ava/typescript": "^3.0.1",
"@sinonjs/fake-timers": "^8.1.0",
"ansi-escapes": "^5.0.0",
"c8": "^7.10.0",
"c8": "^7.11.0",
"delay": "^5.0.0",
"execa": "^5.1.1",
"execa": "^6.0.0",
"fs-extra": "^10.0.0",
"get-stream": "^6.0.1",
"replace-string": "^4.0.0",
"sinon": "^11.1.2",
"tap": "^15.0.10",
"sinon": "^12.0.1",
"tap": "^15.1.5",
"temp-write": "^5.0.0",
"tempy": "^2.0.0",
"touch": "^3.1.0",
"tsd": "^0.18.0",
"tsd": "^0.19.1",
"typescript": "^4.4.4",
"xo": "^0.46.3",
"xo": "^0.47.0",
"zen-observable": "^0.8.15"

@@ -145,0 +144,0 @@ },

@@ -9,3 +9,3 @@ # <img src="media/header.png" title="AVA" alt="AVA logo" width="530">

![](media/mini-reporter.gif)
![](media/verbose-reporter.png)

@@ -151,5 +151,3 @@

- [TypeScript](docs/recipes/typescript.md)
- [Using ES modules](docs/recipes/es-modules.md)
- [Passing arguments to your test files](docs/recipes/passing-arguments-to-your-test-files.md)
- [Testing React components](docs/recipes/react.md)
- [Testing Vue.js components](docs/recipes/vue.md)

@@ -193,3 +191,2 @@ - [Debugging tests with Chrome DevTools](docs/recipes/debugging-with-chrome-devtools.md)

- [@ava/typescript](https://github.com/avajs/typescript) — Test TypeScript projects
- [@ava/babel](https://github.com/avajs/babel) — Compile test files using Babel, for AVA 3
- [@ava/cooperate](https://github.com/avajs/cooperate) — Low-level primitives to enable cooperation between test files

@@ -196,0 +193,0 @@ - [@ava/get-port](https://github.com/avajs/get-port) — Reserve a port while testing

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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