0.1.2 • Published 7 years ago

knex-spec-helper v0.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Knex Spec Helper

Helper functions for tests with knex and knextancy.

Basically the setup runs a truncate script to clean all tables and returns a configured knex connection. Running with knextancyEnabled it will return already a connection by tenant.

Install

npm install -D knex-spec-helper

Usage

Example with Mocha

import knexConfig from '../your-knex-config';
import knexSpecHelper from 'knex-spec-helper';

beforeEach(async function () {
  this.knex = await knexSpecHelper.setup({
    knexConfig: knexConfig,
    knextancyEnabled: true,
    truncateEnabled: true,
  });
});

License

Licensed under The MIT License Redistributions of files must retain the above copyright notice.

0.1.2

7 years ago

0.1.1

8 years ago

0.1.0

8 years ago