Skip to content

Commit 01d453f

Browse files
authored
(#157) - update and fix tests
1 parent 20c33e5 commit 01d453f

File tree

6 files changed

+38
-21
lines changed

6 files changed

+38
-21
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ _users
1010
_replicator
1111
config.json
1212
log.txt
13+
/pouchdb
14+
/tmp

.travis.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
language: node_js
22

33
node_js:
4-
- "stable"
4+
- "6"
55

66
sudo: false
77

88
git:
99
depth: 30
1010

1111
addons:
12-
firefox: "41.0.1"
12+
firefox: "47.0.2"
1313

1414
script: npm run $COMMAND
1515

1616
before_script:
17+
# Our test-browser.js script uses FIREFOX_BIN to find the Firefox binary
18+
# See https://github.com/travis-ci/travis-ci/issues/4649
19+
- echo "using firefox $(firefox --version)"
20+
- export FIREFOX_BIN=$(which firefox)
21+
# The next two lines are required for Firefox to run on Travis
1722
- "export DISPLAY=:99.0"
1823
- "sh -e /etc/init.d/xvfb start"
24+
# Fail early if there's a jshint problem
25+
- npm run jshint
1926

2027
env:
2128
global:
@@ -24,7 +31,6 @@ env:
2431
- secure: "MiufQQKR/EBoS7kcau/I7oYenVilysEqwx37zdgLEKlEUe3SxVOe31uLZv/bhfLNZiRuLAfmIOZmhLGnhMf0LaBzR2yC5qhBxrVHcAiTuS3q6zxpzEf02jnu+hACvj1kJJEPjpOLpEVx7ghWL4McEO0qLbdtSbQlm2IkOX1ONg0="
2532

2633
matrix:
27-
- COMMAND=jshint
2834
- CLIENT=node COMMAND=test-pouchdb
2935
- CLIENT=node SERVER_ARGS=--in-memory COMMAND=test-pouchdb
3036
- CLIENT=node SERVER_ARGS=--sqlite COMMAND=test-pouchdb

bin/test-pouchdb.sh

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
11
#!/bin/bash
22

3-
# install pouchdb from git master rather than npm,
4-
# so we can run its own tests
5-
rm -fr node_modules/pouchdb
6-
git clone --depth 1 --single-branch --branch master \
7-
https://github.com/pouchdb/pouchdb.git node_modules/pouchdb
3+
rm -fr tmp
4+
mkdir -p tmp
5+
cd tmp
86

9-
cd node_modules/pouchdb/
10-
npm install
11-
12-
cd ../..
13-
14-
./bin/pouchdb-server -n -p 6984 $SERVER_ARGS &
7+
../bin/pouchdb-server -n -p 6984 $SERVER_ARGS &
158
POUCHDB_SERVER_PID=$!
169

17-
cd node_modules/pouchdb/
10+
cd ../pouchdb
1811

19-
COUCH_HOST=http://localhost:6984 TIMEOUT=120000 npm run test-node
12+
COUCH_HOST=http://127.0.0.1:6984 TIMEOUT=120000 npm run test-node
2013

2114
EXIT_STATUS=$?
2215
if [[ ! -z $POUCHDB_SERVER_PID ]]; then

bin/test-setup.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
# install pouchdb from git rather than npm,
4+
# so we can run its own tests
5+
# also this branch may change as we update pouchdb
6+
# versions because we can't necessarily test against
7+
# the master tests since we use the version of pouchdb
8+
# from npm
9+
rm -rf pouchdb
10+
git clone --single-branch \
11+
--branch master \
12+
--depth 1 \
13+
https://github.com/pouchdb/pouchdb.git pouchdb
14+
cd pouchdb
15+
npm install
16+
cd -

lib/logging.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var Tail = require('tail').Tail;
44
var LogParser = require('couchdb-log-parse');
55
var colors = require('colors/safe');
66
var fs = require('fs');
7-
var Promise = require('bluebird');
7+
var Promise = require('pouchdb-promise');
88

99
var parser = new LogParser();
1010
parser.on('message', function (msg) {

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,28 @@
1616
},
1717
"scripts": {
1818
"start": "node ./bin/pouchdb-server",
19-
"test-pouchdb": "./bin/test-pouchdb.sh",
20-
"test-couchdb": "./bin/test-couchdb.sh",
19+
"test-pouchdb": "./bin/test-setup.sh && ./bin/test-pouchdb.sh",
20+
"test-couchdb": "./bin/test-setup.sh && ./bin/test-couchdb.sh",
2121
"jshint": "./node_modules/.bin/jshint bin/pouchdb-server lib"
2222
},
2323
"engines": {
2424
"node": ">= 0.8.0"
2525
},
2626
"dependencies": {
27-
"bluebird": "^2.4.2",
2827
"colors": "^1.0.3",
2928
"corser": "~2.0.0",
3029
"couchdb-harness": "*",
3130
"couchdb-log-parse": "^0.0.3",
3231
"express": "^4.10.4",
33-
"express-pouchdb": "~1.0.4",
32+
"express-pouchdb": "^2.1.3",
3433
"http-pouchdb": "^1.1.0",
3534
"killable": "^1.0.0",
3635
"memdown": "^1.0.0",
3736
"mkdirp": "^0.5.0",
3837
"nomnom": "^1.8.1",
3938
"pouchdb-adapter-node-websql": "^6.0.7",
4039
"pouchdb-node": "^6.0.7",
40+
"pouchdb-promise": "6.1.0",
4141
"serve-favicon": "~2.0.1",
4242
"tail": "^0.4.0",
4343
"wordwrap": "0.0.2"

0 commit comments

Comments
 (0)