• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

idrinth-api-bench / framework / 9822524417

06 Jul 2024 10:28PM UTC coverage: 71.942% (-3.7%) from 75.611%
9822524417

push

github

web-flow
remove unused code & adjust verification code (#47)

* remove unused code
adjust verification code

* Update src/main.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update src/main.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update src/cli/cli.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* eslint fixes

* eslint fixes

* remove impossible test

* fix code to be actually functional

fixes #0

* fix code to be actually functional

fixes #0

* fix code to be actually functional

fixes #0

* update dependency

fixes #0

* update dependency

fixes #0

* update gitignore
publish first release

fixes #0

* fix import

fixes #0

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

311 of 485 branches covered (64.12%)

Branch coverage included in aggregate %.

24 of 81 new or added lines in 5 files covered. (29.63%)

155 existing lines in 5 files now uncovered.

2412 of 3300 relevant lines covered (73.09%)

2538.08 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

30.91
/src/load/loader.ts
1
import {
3!
2
  EMPTY,
3✔
3
  ONE,
3✔
4
  DEFAULT_LANGUAGE,
3✔
5
} from '../constants.js';
3✔
6
import fse from 'fs-extra';
3✔
7
import run from '../main.js';
3✔
8
import language, {
3✔
9
  locale,
3✔
10
} from '../helper/language.js';
3✔
11
import jobCreator from '../routes/job-creator.js';
3✔
12
import Config from '../config/config.js';
3✔
13
import defaultReporter from '../reporter/default-reporter.js';
3✔
14

3✔
15
// eslint-disable-next-line complexity
3✔
16
const loadUp = async(config: Config,) => {
3✔
NEW
17
  await locale(config.language ?? DEFAULT_LANGUAGE,);
×
NEW
18
  if (config.maximum < config.threads) {
×
NEW
19
    throw new Error(language('maximum_below_threads',),);
×
NEW
20
  }
×
NEW
21
  if (config.increment < ONE) {
×
NEW
22
    throw new Error(language('increment_below_one',),);
×
NEW
23
  }
×
NEW
24
  if (config.maximum < ONE) {
×
NEW
25
    throw new Error(language('maximum_below_one',),);
×
NEW
26
  }
×
NEW
27
  const runs = {};
×
NEW
28
  const job = await jobCreator(`${ config.cwd }`,);
×
NEW
29
  for (const task of job.main || []) {
×
NEW
30
    let threads = config.threads;
×
NEW
31
    do {
×
NEW
32
      // eslint-disable-next-line no-await-in-loop
×
NEW
33
      await run({
×
NEW
34
        language: config.language,
×
NEW
35
        mode: 'load-testing',
×
NEW
36
      }, threads, config.repetitions, {
×
NEW
37
        ...job,
×
NEW
38
        main: [ task, ],
×
NEW
39
      },);
×
NEW
40
      const execution = fse.readJsonSync(config.cwd + '/result.json', 'utf-8',);
×
NEW
41
      let hasErrors = false;
×
NEW
42
      for (const test of Object.keys(execution,)) {
×
NEW
43
        hasErrors = hasErrors || execution[test].errors > EMPTY;
×
NEW
44
        runs[test + ' x' + threads] = execution[test];
×
NEW
45
      }
×
NEW
46
      if (hasErrors) {
×
NEW
47
        break;
×
NEW
48
      }
×
NEW
49
      threads += config.increment;
×
NEW
50
    } while (threads <= config.maximum);
×
NEW
51
  }
×
NEW
52
  defaultReporter(runs, config.cwd);
×
NEW
53
};
×
54
export default loadUp;
3✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc