[npm cli] how do I put the configuration of unit tests into cli?

want to use cli to do unit testing under the project

There are no configuration files under the

project, only files like entry and xxx.test.js . I want to execute cli test in the root directory of the project and run the test unit with the configuration in cli instead of writing the test configuration again in the project

went to see create-react-app and the larger cli project, but I didn"t know where to come from.

all I can think of now is that when I execute test, I copy the configuration file to the project and add it to ignore, but I don"t feel very comfortable.

related codes

-sharp!/usr/bin/env node

const { spawn } = require("child_process");
const path = require("path");

function runCmd(cmd, args, callback) {
  args = args || [];
  const ls = spawn(cmd, args, {
    // keep color
    stdio: "inherit",
  });
  ls.on("close", code => {
    callback && callback(code);
  });
}

// jest --config jest.js --verbose=false
const jestBin = require.resolve("jest/bin/jest");
// cwd  cli 
//  __dirname 
const jestConfig = path.join(process.cwd(), "/scripts/jest.js");
const args = [
  jestBin,
  "--config",
  jestConfig,
  "--verbose=false",
];
runCmd("node", args);

the command you want to execute here is jest-- config jest.js-- verbose=false

want to give a thought or keyword

Apr.12,2022
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9ba01-186b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9ba01-186b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?