Permalink
Cannot retrieve contributors at this time
19 lines (15 sloc)
607 Bytes
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/ava/lib/worker/guard-environment.cjs
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const path = require('node:path'); | |
const process = require('node:process'); | |
const {isRunningInThread, isRunningInChildProcess} = require('./utils.cjs'); | |
// Check if the test is being run without AVA cli | |
if (!isRunningInChildProcess && !isRunningInThread) { | |
if (process.argv[1]) { | |
const fp = path.relative('.', process.argv[1]); | |
console.log(); | |
console.error(`Test files must be run with the AVA CLI:\n\n $ ava ${fp}\n`); | |
process.exit(1); // eslint-disable-line unicorn/no-process-exit | |
} else { | |
throw new Error('The ’ava’ module can only be imported in test files'); | |
} | |
} |