# @adonisjs/vow

> Test runner for Adonis framework with batteries included 🔋

Latest version **1.0.17** (published 2018-10-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install @adonisjs/vow
pnpm add @adonisjs/vow
yarn add @adonisjs/vow
bun add @adonisjs/vow
```

## 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.0.17 |
| Published | 2018-10-01 |
| First published | 2017-08-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 70.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 56 |
| Author | virk |
| Maintainers | romainlanz, virk |

## Links

- npm: https://www.npmjs.com/package/@adonisjs/vow
- Repository: https://github.com/adonisjs/adonis-vow
- Homepage: https://github.com/adonisjs/adonis-vow#readme
- Issues: https://github.com/adonisjs/adonis-vow/issues
- npm.io page: https://npm.io/package/@adonisjs/vow

## Dependencies (9)

- [japa](https://npm.io/package/japa.md) 1.0.6
- [debug](https://npm.io/package/debug.md) ^4.0.1
- [globby](https://npm.io/package/globby.md) ^8.0.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [p-series](https://npm.io/package/p-series.md) ^1.1.0
- [macroable](https://npm.io/package/macroable.md) ^1.0.0
- [superagent](https://npm.io/package/superagent.md) ^4.0.0-beta.5
- [chai-subset](https://npm.io/package/chai-subset.md) ^1.6.0
- [node-cookie](https://npm.io/package/node-cookie.md) ^2.1.1

## Recent versions

- 1.0.17 (latest) — 2018-10-01
- 1.0.16 — 2018-07-16
- 1.0.15 — 2018-02-07
- 1.0.14 — 2018-02-01
- 1.0.13 — 2017-10-29
- 1.0.12 — 2017-10-03
- 1.0.11 — 2017-09-26
- 1.0.10 — 2017-09-25
- 1.0.9 — 2017-09-25
- 1.0.8 — 2017-09-16
- 1.0.7 — 2017-09-14
- 1.0.6 — 2017-09-14
- 1.0.5 — 2017-09-08
- 1.0.4 — 2017-08-29
- 1.0.3 — 2017-08-29
- … 3 more at https://npm.io/package/@adonisjs/vow/versions

## README

# Adonis vow 💂

| Test runner for Adonis framework with batteries included 🔋


[![NPM Version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Appveyor][appveyor-image]][appveyor-url]
[![Coveralls][coveralls-image]][coveralls-url]

Adonis vow is the test runner for Adonis framework, just install and register the provider and BOOM it just works.

<img src="http://res.cloudinary.com/adonisjs/image/upload/q_100/v1497112678/adonis-purple_pzkmzt.svg" width="200px" align="right" hspace="30px" vspace="40px">

## Setup

```bash
adonis install @adonisjs/vow
```

Read setup [instructions](instructions.md)

## Concepts

The test runner is bare bones that you need to setup and run tests using your command line. But it comes with a powerful concept of traits.

### Traits

Traits are building blocks for your tests. Features like **Database transactions**, **Api client**, **Browser client**, they all are built on top of the API provided by traits.

```js
const { trait } = use('Test/Suite')('Sample test suite')

trait((suiteInstance) => {
})
```

### Suite
A test suite is a combination of tests that you want to group inside a single file or group them logically.

Each suite has it's own set of traits, which means adding traits for a single suite, doesn't collides with the other suite :)

### Hooks
Each suite has a lifecycle and you can hook into that lifecycle by adding methods to one of the following events.

```js
const suite = use('Test/Suite')('Sample test suite') 

suite.before(() => {
 // executed before the suite
})

suite.after(() => {
 // executed after the suite
})

suite.beforeEach(() => {
 // executed before each test
})

suite.afterEach(() => {
 // executed after each test
})
```

### Context

Each test suite has a context, which is instantiated and passed to each test, so this is the right place to hook stuff that you want to be available to tests.

```js
const { trait, test } = use('Test/Suite')('Sample test suite')

trait((suite) => {
  suite.Context.getter('foo', () => 'bar')
})


test('foo is bar', (ctx) => {
  ctx.assert(ctx.foo, 'bar')
})

// using es6 destructuring
test('foo is bar', ({ foo, assert }) => {
  assert(foo, 'bar')
})
```


### Development

The tests for the test runner are written using [japa](https://github.com/thetutlage/japa) and make sure to go through the docs.

## Release History

Checkout [CHANGELOG.md](CHANGELOG.md) file for release history.

## Meta

AdonisJs – [@adonisframework](https://twitter.com/adonisframework) – virk@adonisjs.com

Checkout [LICENSE.txt](LICENSE.txt) for license information

Harminder Virk (Aman) - [https://github.com/thetutlage](https://github.com/thetutlage)

[appveyor-image]: https://img.shields.io/appveyor/ci/thetutlage/adonis-vow/master.svg?style=flat-square

[appveyor-url]: https://ci.appveyor.com/project/thetutlage/adonis-vow

[npm-image]: https://img.shields.io/npm/v/@adonisjs/vow.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@adonisjs/vow

[travis-image]: https://img.shields.io/travis/adonisjs/adonis-vow/master.svg?style=flat-square
[travis-url]: https://travis-ci.org/adonisjs/adonis-vow

[coveralls-image]: https://img.shields.io/coveralls/adonisjs/adonis-vow/develop.svg?style=flat-square

[coveralls-url]: https://coveralls.io/github/adonisjs/adonis-vow

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