
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@asfrom30/test-utils
Advanced tools
```js const path = require('path'); const { setup: appSetup } = require('./fake-application/src');
const path = require('path');
const { setup: appSetup } = require('./fake-application/src');
const TestUtils = require('../../src');
const { PathsExtractor, ConfigLoader, Runner } = TestUtils.Mocha;
const { isBrokenAtLeast, printResultPretty } = TestUtils.Utils;
(async () => {
try {
console.log('start setup');
// 1. FindMocharc
// const paths = pathExtractor.fromPaths();
const dir = path.join(__dirname, './fake-application');
const pathExtractor = new PathsExtractor();
const paths = pathExtractor.fromDir(dir);
// 2. Ask which mocharc to run using cli
// TODO: 찾아낸 mocharc를 cli로 선택하도록 물어본다.
// 만약 -y옵션이 true이면 그냥 다 선택하고 넘어간다.
// 3. convert mocharcPath to Config
const mochaConfigs = ConfigLoader.load(paths);
// 4. Run Unit Test
const unitTestResult = await new Runner()
.addConfig(mochaConfigs[0])
.changeReporter('dot')
.run();
printResultPretty(unitTestResult);
// 5. Application Setup
await appSetup();
// 6. Run integration and Scenario
const testResults = await new Runner()
.addConfig(mochaConfigs)
.changeReporter('dot')
.run();
printResultPretty(testResults);
// 7. sketch
isBrokenAtLeast(unitTestResult, testResults)
? process.exit(1)
: process.exit(0);
} catch (error) {
console.error(error); // prevent to uncaught error
}
})();
//jsconfig.json
"allowJs": true
const { Mocha } = require('@asfrom30/test-utils');
{
"test": "NODE_ENV=test ts-node test.ts",
"tdd": "NODE_ENV=test nodemon --exec 'ts-node' test.ts"
}
{}
$ npm run test -- --y // it may help in CI
$ npm run tdd -- --y
.changeReporter();
reporter list
> expected output
[API] users.api.spec.ts
$ nodemon tests/scenario1/test.js --mocharc /Volumes/sourcehub/projects/@asfrom30/npm/test-utils/tests/.resources/a/.mocharc
or
$ nodemon tests/scenario1/test.js --mocharc {mocharcPath}
FAQs
```js const path = require('path'); const { setup: appSetup } = require('./fake-application/src');
The npm package @asfrom30/test-utils receives a total of 0 weekly downloads. As such, @asfrom30/test-utils popularity was classified as not popular.
We found that @asfrom30/test-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.