# oj-test-runner

> OJ test cases runner

Latest version **1.2.1** (published 2016-05-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install oj-test-runner
pnpm add oj-test-runner
yarn add oj-test-runner
bun add oj-test-runner
```

Provides the command `run-test`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2016-05-21 |
| First published | 2016-05-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Chriest Yu |
| Maintainers | jcppman |

## Links

- npm: https://www.npmjs.com/package/oj-test-runner
- Repository: https://github.com/jcppman/coursera-test-runner
- Homepage: https://github.com/jcppman/coursera-test-runner#readme
- Issues: https://github.com/jcppman/coursera-test-runner/issues
- npm.io page: https://npm.io/package/oj-test-runner

## Dependencies (2)

- [glob](https://npm.io/package/glob.md) ^7.0.3
- [async](https://npm.io/package/async.md) ^1.5.2

## Recent versions

- 1.2.1 (latest) — 2016-05-21
- 1.2.0 — 2016-05-21

## README

# oj-test-runner
JS test cases runner for OJ things.

## Install

- `npm install -g oj-test-runner`

## Usage

### Folder mode

`run-test YOUR_SCRIPT TESTS_FOLDER`

- `YOUR_SCRIPT`: your solution js file
- `TESTS_FOLDER`: folder that contains all test cases

test cases & answers inside folder are formed as:

- `${testCaseNumber}`: test case
- `${testCaseNumber}.a`: expected output

**all intergers are valid, doesn't need to be in sequence**

e.g: folder `tests` contains four files `1`, `1.a`, `2`, `2.a`.

when executing `run-test ./my-solution.js tests`

`tests/1` will be piped to `./my-solution.js`'s stdin and
it's stdout will be used to diff with `1.a` to check if the output is
valid.

then `tests/2` with `tests/2.a`

### Stress test mode

`run-test CORRECT_SOLUTION FAST_SOLUTION TEST_CASE_GENERATOR PRINT_TESTCASE`

- `CORRECT_SOLUTION`: the slow but correct solution script
- `FAST_SOLUTION`: your fast final solution script
- `TEST_CASE_GENERATOR`: a script that exports a function that will generates
a new test case per execution.
- `PRINT_TESTCASE_DESC`: if `true`, print out test case, regarded as `false` if
not given

---
_Source: https://npm.io/package/oj-test-runner · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
