# circom_tester

> Tools for testing circom circuits.

Latest version **0.0.24** (published 2025-06-10) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install circom_tester
pnpm add circom_tester
yarn add circom_tester
bun add circom_tester
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

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

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.24 |
| Published | 2025-06-10 |
| First published | 2021-10-06 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 43.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 68 |
| Author | Albert Rubio |
| Maintainers | jbaylina, obrezhniev |
| Keywords | circom, test, snarkjs, iden3 |

## Links

- npm: https://www.npmjs.com/package/circom_tester
- Repository: https://github.com/iden3/circom_tester
- Homepage: https://github.com/iden3/circom_tester#readme
- Issues: https://github.com/iden3/circom_tester/issues
- npm.io page: https://npm.io/package/circom_tester

## Dependencies (7)

- [chai](https://npm.io/package/chai.md) ^4.3.6
- [util](https://npm.io/package/util.md) ^0.12.5
- [snarkjs](https://npm.io/package/snarkjs.md) ^0.7.5
- [fnv-plus](https://npm.io/package/fnv-plus.md) ^1.3.1
- [r1csfile](https://npm.io/package/r1csfile.md) ^0.0.48
- [tmp-promise](https://npm.io/package/tmp-promise.md) ^3.0.3
- [ffjavascript](https://npm.io/package/ffjavascript.md) ^0.3.1

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 0.0.24 (latest) — 2025-06-10
- 0.0.23 — 2025-05-29
- 0.0.22 — 2025-05-14
- 0.0.21 — 2025-03-20
- 0.0.20 — 2023-10-26
- 0.0.19 — 2022-10-31
- 0.0.18 — 2022-09-07
- 0.0.17 — 2022-09-02
- 0.0.16 — 2022-09-02
- 0.0.15 — 2022-08-30
- 0.0.14 — 2022-06-17
- 0.0.13 — 2022-06-15
- 0.0.12 — 2022-06-10
- 0.0.11 — 2022-04-26
- 0.0.10 — 2022-03-11
- … 8 more at https://npm.io/package/circom_tester/versions

## README

# circom tester
## Setup
1. Create new node js project.
2. Install `circom_tester` and `chai` packges.
3. Install `mocha` packge to run the tests.


## Creating & Running a test file

Create a js file contain the following code or use the src provided in the following section.
<br>Execue `mocha -p -r ts-node/register 'multiplier2.js'` to run the test file.

multiplier2.js ([src](test/multiplier2.js))
``` multiplier2.js
const chai = require("chai");
const path = require("path");
const wasm_tester = require("./../index").wasm;
const c_tester = require("./../index").c;

const F1Field = require("ffjavascript").F1Field;
const Scalar = require("ffjavascript").Scalar;
exports.p = Scalar.fromString("21888242871839275222246405745257275088548364400416034343698204186575808495617");
const Fr = new F1Field(exports.p);

const assert = chai.assert;

describe("Simple test", function () {
    this.timeout(100000);

    it("Checking the compilation of a simple circuit generating wasm", async function () {
        const circuit = await wasm_tester(path.join(__dirname, "Multiplier2circom"));
        const w = await circuit.calculateWitness({a: 2, b: 4});
        await circuit.checkConstraints(w);
    });
});
```

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