New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@adonisjs/vow

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adonisjs/vow

Test runner for Adonis framework with batteries included 🔋

  • 1.0.17
  • latest
  • legacy
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.4K
increased by2.75%
Maintainers
2
Weekly downloads
 
Created
Source

Adonis vow 💂

| Test runner for Adonis framework with batteries included 🔋

NPM Version Build Status Appveyor Coveralls

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

Setup

adonis install @adonisjs/vow

Read setup instructions

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.

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.

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.

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 and make sure to go through the docs.

Release History

Checkout CHANGELOG.md file for release history.

Meta

AdonisJs – @adonisframeworkvirk@adonisjs.com

Checkout LICENSE.txt for license information

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

FAQs

Package last updated on 01 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc