Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-environment-knex

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-environment-knex

[![Github Master CI Status](https://github.com/SocialGouv/jest-environment-knex/workflows/ci/badge.svg?branch=master)](https://github.com/SocialGouv/jest-environment-knex/actions/) [![codecov](https://codecov.io/gh/SocialGouv/jest-environment-knex/branch/

  • 3.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

jest-environment-knex

Github Master CI Status codecov NPM version

knex environment in Jest

Tested against SQlite3 and Postgres. See __tests__

Install

$ npm install --save-dev jest-environment-knex
# or
$ yarn -D jest-environment-knex

Usage

const { knex } = global;

beforeAll(async () => {
  await knex.migrate.latest();
  await knex.seed.run();
});

test("should list all tables", async () => {
  const query = `
    SELECT table_name FROM information_schema.tables
    WHERE table_schema = current_schema() AND table_catalog = ?
  `;
  const results = await knex.raw(query, [knex.client.database()]);
  expect(results.rows.map((row) => row.table_name).sort()).toMatchSnapshot();
});

Release policy

Releases are automaticly made through our GitHub Actions strictly following the Semantic Versioning specification thanks to semantic-release.

FAQs

Package last updated on 27 Oct 2020

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