# brotest

> Test code in web browser.

Latest version **1.1.0** (published 2022-05-19) · GPL-3.0 license · 0 weekly downloads

## Install

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

Provides the command `brotest`.

## 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.1.0 |
| Published | 2022-05-19 |
| First published | 2022-05-18 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 17.0.0 |
| Dependencies | 1 |
| Unpacked size | 40.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Konrad Chmielecki |
| Maintainers | 3mam |
| Keywords | test, webbrowser |

## Links

- npm: https://www.npmjs.com/package/brotest
- Repository: https://github.com/3mam/brotest
- Homepage: https://github.com/3mam/brotest#readme
- Issues: https://github.com/3mam/brotest/issues
- npm.io page: https://npm.io/package/brotest

## Dependencies (1)

- [parcel](https://npm.io/package/parcel.md) ^2.5.0

## 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.1.0 (latest) — 2022-05-19
- 1.0.2 — 2022-05-18
- 1.0.1 — 2022-05-18
- 1.0.0 — 2022-05-18

## README

# brotest
Tool for testing code in web browser.

features:
 * support asynchronous programming
 * hot reloading
 * typescript
 * automatically added file that contains **.test.** in file name
 * focus on class that current working on


## config

Brotest require to set folder where source code is.
In this example is **src**.
**package.json**
```js
  "scripts": {,
    "test": "npx brotest src",
  },
```

## usage
Ich test must contain **.test.** in file name. In files must by set **export default class**.
Ich public method in class must contain assert parameter. Assert is callback for function that is responsible to check if test is correct.
In assert first argument must by boolean, second is string that is optional. When first argument is set to **true** test display as ok. When is set to **false** is display as bad. When status is bad, optional message is shown.

## example

```js
export default class {
  test1(assert) {
    //test pass
    assert(true)
  }

  test2(assert) {
    //test failed
    assert(false, "Something is wrong!")
  }
}
```
![image](./img/show.png)

## issues
Sometime hot reload don't work when test is created. This require manual reload page.

## demo video
[![watch video](https://img.youtube.com/vi/sY_C3skjVIk/0.jpg )](https://youtu.be/sY_C3skjVIk)

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