Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/3mam/brotest
Tool for testing code in web browser..
https://github.com/3mam/brotest
Last synced: about 1 month ago
JSON representation
Tool for testing code in web browser..
- Host: GitHub
- URL: https://github.com/3mam/brotest
- Owner: 3mam
- License: gpl-3.0
- Created: 2022-05-18T08:54:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-06-09T08:36:01.000Z (over 2 years ago)
- Last Synced: 2024-04-24T16:38:12.142Z (9 months ago)
- Language: HTML
- Homepage: https://www.npmjs.com/package/brotest
- Size: 896 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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
Tests 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 **PASS**. When is set to **false** is display as FAIL. When status is **FAIL**, 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)