# assert-to-expect

> change from assert to jest's expect

Latest version **1.0.1** (published 2022-12-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install assert-to-expect
pnpm add assert-to-expect
yarn add assert-to-expect
bun add assert-to-expect
```

Provides the command `assert-to-expect`.

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2022-12-03 |
| First published | 2022-12-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14.0.0 |
| Dependencies | 2 |
| Unpacked size | 11.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Kingller Tang |
| Maintainers | kingller |
| Keywords | assert, expect, jest, node |

## Links

- npm: https://www.npmjs.com/package/assert-to-expect
- npm.io page: https://npm.io/package/assert-to-expect

## Dependencies (2)

- [chalk](https://npm.io/package/chalk.md) ^4.1.2
- [commander](https://npm.io/package/commander.md) ^9.4.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
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2022-12-03
- 1.0.0 — 2022-12-03

## README

# assert-to-expect
change from assert to jest's expect

## Installation

```
npm install assert-to-expect
```

## Usage

```
npx assert-to-expect [path] -m [matchRegex]
```

Example:

```
npx assert-to-expect ./src -m .*\\.tsx$
```

You can change the code using assert to use expect as bellow.

The code before change,

```
import assert from 'assert';

assert(wrapper.instance() instanceof Int);
assert.strictEqual(wrapper.find('Dropdown').length, 1);
assert.deepStrictEqual(wrapper.prop('texts'), ['react', 'vue']);
```

The code after change,
```
expect(wrapper.instance() instanceof Int).toBe(true);
expect(wrapper.find('Dropdown').length).toBe(1);
expect(wrapper.prop('texts')).toEqual(['react', 'vue']);
```

### path

The value of path to change.

### matchRegex

Regular expression for matching files.

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