-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
The below example silently fails and does not complete the promise. It seems to happen when I try to query and emit a document that has a % sign. If I remove the % sign everything works.
I've tested using both the leveldb and the idb adapters using PouchDB version 2.2.3 and 3.0.1. I was wondering if anyone else could reproduce with the below code:
var PouchDB = require('pouchdb');
var db = new PouchDB('testdb', { db: require('memdown') });
describe('PouchDB', function() {
it('should insert a document', function (done) {
db.put({_id: "123-456-789", message: "I 100% agree" })
.then(function(result){
expect(result.ok).toBe(true);
expect(result.id).toBe("123-456-789");
done();
})
.catch(function(err){
console.log(err)
expect(err).toBeUndefined();
done();
});
});
it('should retrieve a list of documents', function (done) {
function map(doc, emit) {
emit(doc);
}
db.query({ map: map, reduce: false})
.then(function(result){
expect(result.total_rows).toBe(1);
expect(result.offset).toBe(0);
expect(result.rows[0].id).toBe('123-456-789');
done();
})
.catch(function(err){
expect(err).toBeUndefined();
done();
});
});
});output:
jasmine-node CouchIssue-spec.js
.F
Failures:
1) PouchDB should retrieve a list of documents
Message:
timeout: timed out after 5000 msec waiting for spec to complete
Stacktrace:
undefined
Finished in 5.507 seconds
2 tests, 3 assertions, 1 failure, 0 skipped
output if I remove the % sign:
jasmine-node CouchIssue-spec.js
..
Finished in 0.063 seconds
2 tests, 5 assertions, 0 failures, 0 skipped
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels