Skip to content

Commit

Permalink
chore: add 'nyc' for test coverage, add 'standard-version' for releas…
Browse files Browse the repository at this point in the history
…e management. (#7)

* chore: added nyc and standard-version dependencies

* chore: remove license in favor of Olivier's

* chore: push coverage to coveralls after tests pass

* nit: remove extra '
  • Loading branch information
bcoe committed Sep 14, 2016
1 parent 6ecc3cb commit 762166d
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
node_modules
.nyc_output
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ services:
- postgresql
env:
- PG_CONNECTION_STRING="postgres://postgres@localhost"
after_success: npm run coverage
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

[![Build
Status](https://travis-ci.org/olalonde/pgtools.svg?branch=master)](https://travis-ci.org/olalonde/pgtools)
[![Coverage Status](https://coveralls.io/repos/github/olalonde/pgtools/badge.svg?branch=master)](https://coveralls.io/github/olalonde/pgtools?branch=master)
[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)


Pure Node.js implementation of PostgreSQL's
[createdb](http://www.postgresql.org/docs/9.4/static/app-createdb.html)
Expand Down Expand Up @@ -52,9 +55,9 @@ pgtools.createdb(config, 'test-db', function (err, res) {

# Usage

pgtools.createdb(config, dbname [, cb(err)])
`pgtools.createdb(config, dbname [, cb(err)])`

pgtools.dropdb(config, dbname [, cb(err)])
`pgtools.dropdb(config, dbname [, cb(err)])`

* _object_ __config__

Expand All @@ -76,3 +79,14 @@ pgtools.dropdb(config, dbname [, cb(err)])

* `createdbjs`: which emulates pgtools' `createdb` functionality.
* `dropdbjs`: which emulates pgtools' `dropdb` functionality.

## Releasing

Rather than manually running `npm version <patch|minor|major>`, instead run:

```
npm run release
```

This will automatically generating a CHANGELOG, and bump your package version
based on [the angular commit format](https://github.com/conventional-changelog/conventional-changelog-angular/blob/master/convention.md).
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@
"createdbjs": "./createdb.js",
"dropdbjs": "./createdb.js"
},
"devDependencies": {},
"devDependencies": {
"coveralls": "^2.11.12",
"nyc": "^8.1.0",
"standard-version": "^2.4.0"
},
"scripts": {
"test": "node test.js",
"docker": "docker-compose up dbcreate && docker-compose up -d db"
"coverage": "nyc report --reporter=text-lcov | coveralls",
"test": "nyc node test.js",
"docker": "docker-compose up dbcreate && docker-compose up -d db",
"release": "standard-verison"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function die (err) {
}

var config = process.env.PG_CONNECTION_STRING || {
host: process.env.DB_HOST || '192.168.99.100',
host: process.env.DB_HOST || '127.0.0.1',
user: process.env.DB_USER || 'postgres',
}

Expand Down

0 comments on commit 762166d

Please sign in to comment.