forked from pouchdb/pouchdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(pouchdb#913) - Add basic tests to new suite, compile tests to html
- Loading branch information
1 parent
0381beb
commit cdc9af2
Showing
3 changed files
with
290 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
echo '<!DOCTYPE html><html>' > test.html | ||
echo "<head><meta charset='utf-8'></head>" >> test.html | ||
echo "<script type=\"text/javascript\">" >> test.html | ||
browserify $1 >> test.html | ||
echo "</script></html>" >> test.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/*globals require */ | ||
|
||
'use strict'; | ||
|
||
var PouchDB = require('../../'); | ||
var utils = require('../test.utils.js'); | ||
var opts = require('browserify-getopts'); | ||
|
||
var db1 = opts.db1 || 'testdb1'; | ||
var db2 = opts.db2 || 'testdb2'; | ||
var db3 = opts.db2 || 'testdb3'; | ||
|
||
var test = require('wrapping-tape')(utils.setupDb(db1, db2, db3)); | ||
|
||
test('Replicate without creating src', function(t) { | ||
t.plan(2); | ||
var db = new PouchDB(db1); | ||
var docs = [{a: 'doc'}, {anew: 'doc'}]; | ||
db.bulkDocs({docs: docs}, function() { | ||
PouchDB.replicate(db1, db2, {complete: function(err, changes) { | ||
t.equal(changes.docs_written, docs.length, 'Docs written'); | ||
PouchDB.replicate(db1, db3, {complete: function(err, changes) { | ||
t.equal(changes.docs_written, docs.length, 'Docs written'); | ||
}}); | ||
}}); | ||
}); | ||
}); |