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

RauliL / juokse / 6085297530

05 Sep 2023 01:29PM UTC coverage: 66.667% (-0.9%) from 67.596%
6085297530

push

github

web-flow
Merge pull request #27 from RauliL/return-command

Add builtin return command

174 of 265 branches covered (0.0%)

Branch coverage included in aggregate %.

23 of 23 new or added lines in 3 files covered. (100.0%)

534 of 797 relevant lines covered (67.0%)

128.93 hits per line

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

33.33
/src/builtins/return.ts
1
import { ReturnError } from "../error";
9✔
2
import { ExitStatus } from "../status";
9✔
3
import { builtinCommand } from "./utils";
9✔
4

5
/**
6
 * Exits from an function call with optional status code.
7
 */
8
export const builtinCommandReturn = builtinCommand(0, 1, (context, n) => {
9✔
9
  const nn = n != null ? parseInt(n) : ExitStatus.OK;
×
10

11
  if (isNaN(nn)) {
×
12
    context.stderr.write(`Illegal number: ${n}\n`);
×
13

14
    return Promise.resolve(ExitStatus.ERROR);
×
15
  }
16

17
  return Promise.reject(new ReturnError(nn));
×
18
});
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