1.1.0 • Published 7 years ago

equinox v1.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

Equinox

Testing for Postgres

Write tests, and let equinox do the rest for you!

Install

equinox requires PLV8 to be installed before running tests. PLV8 adds Javascript as an extension in Postgres. There are operating system specific directions available in install.md.

npm install equinox

Usage

Run all tests against a database named database, with the default dot reporter.

$ equinox -d database --files examples/*.js

Options

There are several options available for running tests:

ParameterDescriptionDefault
filesFiles to load and execute
databaseDatabase to run in
hostHostname to connect tolocalhost
userDatabase user to connect with
passwordDatabase password to connect with
reporterTest reporter to use (dot, spec, tap)dot

In addition to these options, it is possible to set environment variables that define the database connection. These will be overridden by any command-line arguments:

  • PGDATABASE
  • PGHOST
  • PGUSER
  • PGPASSWORD

Example Tests

Tests are simple to write and start using immediately.

var tests = [
  {
    'should equal 1': function ( ) {
      var result = plv8.execute('SELECT 1 AS num');
      assert.equal(result.length, 1, "length should be 1");
      assert.equal(result[0].num, 1, "num should equal 1");
    }
  }
];

Contributing

Contributions welcome! Please read the contributing guidelines first.

License

MIT

1.1.0

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago