0.2.0 • Published 7 years ago

tape-pg v0.2.0

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

tape-pg

Build Coverage npm

Decorates the tape function to provide a node-postgres client in each test.

Also optionally runs SQL query before each test.

Usage

var tape = require('tape');
var tapePg = require('tape-pg');
var schema = require('./schema.sql');

var opts = {
  model: 'DROP TABLE IF EXISTS my_table; CREATE TABLE my_table (column VARCHAR NOT NULL);',
  connection: {
    host: 'localhost',
    port: 5432,
  }
};

var test = tapePg(opts, tape);

test('perform some query', (t, client) => {
  client.query('SELECT * FROM my_table', (err, result) => {
    t.end();
  });
});

Unsupported tape features

The following tape features are currently unsupported:

  • .only
  • .skip