# expect-runtime

> expect assertion on the runtime

Latest version **0.10.1** (published 2021-01-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install expect-runtime
pnpm add expect-runtime
yarn add expect-runtime
bun add expect-runtime
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.10.1 |
| Published | 2021-01-08 |
| First published | 2020-08-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 21.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Dadiorchen |
| Maintainers | deanchen |
| Keywords | expect, assertion, test, TDD |

## Links

- npm: https://www.npmjs.com/package/expect-runtime
- Repository: https://github.com/dadiorchen/expect-runtime
- Homepage: https://github.com/dadiorchen/expect-runtime#readme
- Issues: https://github.com/dadiorchen/expect-runtime/issues
- npm.io page: https://npm.io/package/expect-runtime

## 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

- 0.10.1 (latest) — 2021-01-08
- 0.10.0 — 2021-01-03
- 0.9.0 — 2021-01-02
- 0.8.0 — 2021-01-02
- 0.7.0 — 2020-09-29
- 0.6.0 — 2020-09-22
- 0.5.1 — 2020-09-01
- 0.5.0 — 2020-09-01
- 0.4.0 — 2020-08-21
- 0.3.5 — 2020-08-18
- 0.3.4 — 2020-08-18
- 0.3.3 — 2020-08-18
- 0.3.2 — 2020-08-17
- 0.3.1 — 2020-08-17
- 0.3.0 — 2020-08-17
- … 2 more at https://npm.io/package/expect-runtime/versions

## README

The library to assert javascript code on the runtime. 

The name 'expect' was borrowed from Jest. And the syntax of assert is inspired by Jest and Chai. 

# Motivation

1. Javascript is a weak type language

Because that Javascript is a weak type language, when we code interace, like function, API, and so on, we often run into unexpected problem because we are giving the interface wrong augments, sometimes it's because we forgot the interace spec, sometimes it's because we made some refactor, and the type of the arguments changed in the chain of the path passing the arguments from one layer of call to other. 

2. TDD

Test driven development let you write code that throw error first, then write more code to correct it. Using runtime assertion let you find why the test failed earlier, at earlier part of code in you program. That helps.

Don't type a lot of console.log(...) to check the state of your program, scrolling the screen to verify the log, use assertion (both in your test code and real code) to let it alert you when something went wrong. TDD let you just focus your attestion on PROBLEMS.


# How to test

```
npm test
```

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