diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..8eb8fbf --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,41 @@ +version: 2 +jobs: + build-node-common: &common-build + docker: + # The docker section here is not used, but required + - image: circleci/node:6.0.0 + + working_directory: ~/repo + + steps: + - checkout + + - run: npm install + + - run: npm run lint + + - run: npm test + + - run: npm run test-phantom + + - run: npm run coverage + + #- run: npm run report-coverage + + build-6.12.2: + <<: *common-build + docker: + # Travis was using Node.js v5.12.0 which CircleCI does have, therefore use closest match + - image: circleci/node:6.12.2 + + build-8.9.3: + <<: *common-build + docker: + - image: circleci/node:8.9.3 + +workflows: + version: 2 + build_all: + jobs: + - build-6.12.2 + - build-8.9.3 diff --git a/README.md b/README.md index 48f5a75..80aee11 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -node-websql [![Build Status](https://travis-ci.org/nolanlawson/node-websql.svg?branch=master)](https://travis-ci.org/nolanlawson/node-websql) [![Coverage Status](https://coveralls.io/repos/github/nolanlawson/node-websql/badge.svg?branch=master&nonce=foo)](https://coveralls.io/github/nolanlawson/node-websql?branch=master) +node-websql ==== The [WebSQL Database API][websql], implemented for Node diff --git a/test/pouchdb-websql.js b/test/pouchdb-websql.js index 234bd85..5e8ebfb 100644 --- a/test/pouchdb-websql.js +++ b/test/pouchdb-websql.js @@ -880,6 +880,7 @@ function preprocessAttachments(docInfos, blobType, callback) { if (asBinary.error) { return callback(asBinary.error); } + var asBinaryBuffer = new buffer(att.data, 'base64'); att.length = asBinary.length; if (blobType === 'blob') { @@ -889,7 +890,7 @@ function preprocessAttachments(docInfos, blobType, callback) { } else { // binary att.data = asBinary; } - res(asBinary).then(function (result) { + res(asBinaryBuffer).then(function (result) { att.digest = 'md5-' + result; callback(); });