Skip to content

Commit

Permalink
bumped to 1.0.16
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0ttj committed Mar 14, 2020
1 parent 5234fe1 commit f45b60d
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
33 changes: 27 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
<p align="center"><i>"Test environment application"</i><p>
</p>

**Tea** is a software testing suite, similar to `tape`, `jasmine`, `jest`, `cypress`, etc, but much smaller, more lightweight, and with fewer features.
**Tea** is a software testing suite, similar to `node-tap`, `tape`, `mocha`, `jasmine`, etc, but much smaller, more lightweight, and with fewer features.

## Features

- fast, lightweight, minimal code (~4kb minified and gzipped)
- fast, lightweight, minimal code (~4.3kb minified and gzipped)
- very little setup, a fairly complete solution
- includes assertions, test harness, test runner, test reporter
- all in a single file, `src/tea.js`
- supports flexible syntax for writing your tests:
- multiple assertion methods and syntaxes
- grouped and nested tests
Expand All @@ -22,10 +23,11 @@
- NodeJS - show test results in the terminal
- CI environments - show results in the terminal
- supports the following CLI options:
- `--fail-fast`: exit after the first failing test
- `--quiet`: only show failing tests
- `--fail-fast`: exit after the first failing test
- `--verbose`: show expected/actual for all tests (including passing tests)
- `--format=console|tap|debug`: the format of the test results
- `--no-indent`: don't indent grouped results (useful if passing test results to a TAP-format prettifier)

## Installation

Expand Down Expand Up @@ -447,8 +449,9 @@ tea.run()
In summary, to avoid using globals with `tea`:

- don't call `tea()` before your tests
- call `tea.test()` instead of just `tea.test()`
- pass `t` in as a parameter in your tests, or use `tea.assert`, `tea.expect` inside your tests, instead of just `assert`, `expect`
- call `tea.test()` instead of just `test()`
- pass in `t` as a param to your tests...
- ...or use `tea.assert`, `tea.expect` instead of `assert`, `expect`
- call `tea.run()` instead of just `run()`

## Integration tests
Expand Down Expand Up @@ -477,14 +480,29 @@ You can even copy and paste `dist/tea.umd.js` into the DevTools console directly

**NOTE**:

In the browser, passing command-line options like `--quiet` won't work, but you can set `tea.quiet = true`, `tea.args.verbose = true`, and `tea.failFast = true` in the DevTools directly, and then call `run()`.
In the browser, passing command-line options like `--quiet` won't work, but you can set these options in the DevTools directly instead, and then call `run()`:

- `tea.quiet = true|false`
- `tea.args.verbose = true|false`
- `tea.failFast = true|false`
- `tea.reportFormat = 'console|tap|debug'`

You'll be able to see the test results in the DevTools:

<p align="center">
<img src="https://i.imgur.com/PtzXWFW.png" alt="test results shown in DevTools" />
</p>

#### Debug with console.table()

If using the DevTools to see your test results, you can set `tea.reportFormat = 'debug'`, to see your test results in a clickable, filterable `console.table()`:

<p align="center">
<img src="https://i.imgur.com/XHcw1yj.png" alt="test results shown in DevTools, using "debug" format- shows results using console.table()" />
</p>

NOTE: If running tests using Node, you can set `--format=debug` to see the AssertionError stack traces ;)

### Running in a headless browser

You might want to test your app in a real browser, without having to use `<script>` tags and the DevTools. Or, you might need to run tests in a real browser on a system that has no desktop - such as a continuous integration (CI) environment.
Expand Down Expand Up @@ -565,6 +583,9 @@ Rebuild the bundles in `dist/` using this command: `npm run build`
- include wrapper/support for PhantomJS (see `node-phantomjs-simple`)
- bundle phantomjs (32bit and 64bit builds)
- Add better stack traces - resolve them and cut out the irrelevant stuff
- Some kind of snapshotting

Pull Requests welcome ;)

## Acknowledgements

Expand Down
Binary file added assets/debug-test-results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scottjarvis/tea",
"version": "1.0.15",
"version": "1.0.16",
"description": "Test Environment Application",
"author": "sc0ttj",
"license": "MIT",
Expand Down

0 comments on commit f45b60d

Please sign in to comment.