diff --git a/.travis.yml b/.travis.yml index dd9e44e..fca61ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,16 @@ sudo: false language: node_js -node_js: - - 4 - - 5 - - stable + +matrix: + include: + - node_js: 4 + env: CXX=g++-4.8 + - node_js: 6 + env: CXX=g++-4.8 + - node_js: stable + env: + - SAUCE=true + - CXX=g++-4.8 # Make sure we have new NPM. before_install: @@ -14,12 +21,19 @@ script: - npm test - npm run coverage -addons: - firefox: 'latest' - before_script: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start after_success: - npm run coverage-publish + + + +addons: + firefox: 'latest' + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.8 diff --git a/README.md b/README.md index f0eeaf3..1a8e370 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,10 @@ [![Circle CI](https://circleci.com/gh/ipfs/js-cid.svg?style=svg)](https://circleci.com/gh/ipfs/js-cid) [![Dependency Status](https://david-dm.org/ipfs/js-cid.svg?style=flat-square)](https://david-dm.org/ipfs/js-cid) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) +![](https://img.shields.io/badge/npm-%3E%3D3.0.0-orange.svg?style=flat-square) +![](https://img.shields.io/badge/Node.js-%3E%3D4.0.0-orange.svg?style=flat-square) + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/ipfs-js-cid.svg)](https://saucelabs.com/u/ipfs-js-cid) > CID implementation in JavaScript. diff --git a/package.json b/package.json index fc60e72..b0303c2 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,7 @@ "name": "cids", "version": "0.2.0", "description": "cid implementation", - "main": "lib/index.js", - "jsnext:main": "src/index.js", + "main": "src/index.js", "scripts": { "test:node": "aegir-test node", "lint": "aegir-lint", @@ -40,13 +39,13 @@ "multihashes": "^0.2.2" }, "devDependencies": { - "aegir": "^8.0.1", + "aegir": "^9.0.1", "chai": "^3.5.0", - "multihashing": "^0.2.1", - "pre-commit": "^1.1.2" + "multihashing-async": "^0.2.0", + "pre-commit": "^1.1.3" }, "engines": { - "node": ">=4.2.2" + "node": ">=4.0.0" }, "contributors": [ "David Dias ", diff --git a/test/index.spec.js b/test/index.spec.js index f3b238a..ac125db 100644 --- a/test/index.spec.js +++ b/test/index.spec.js @@ -3,7 +3,7 @@ const expect = require('chai').expect const multihash = require('multihashes') -const multihashing = require('multihashing') +const multihashing = require('multihashing-async') const CID = require('../src') @@ -20,17 +20,20 @@ describe('CID', () => { expect(cid.toBaseEncodedString()).to.be.eql(mhStr) }) - it('handles Buffer multihash', () => { - const mh = multihashing(Buffer('hello world'), 'sha2-256') - const mhStr = 'QmaozNR7DZHQK1ZcU9p7QdrshMvXqWK6gpu5rmrkPdT3L4' + it('handles Buffer multihash', (done) => { + multihashing(Buffer('hello world'), 'sha2-256', (err, mh) => { + expect(err).to.not.exist + const mhStr = 'QmaozNR7DZHQK1ZcU9p7QdrshMvXqWK6gpu5rmrkPdT3L4' - const cid = new CID(mh) + const cid = new CID(mh) - expect(cid).to.have.property('codec', 'dag-pb') - expect(cid).to.have.property('version', 0) - expect(cid).to.have.property('multihash').that.eql(mh) + expect(cid).to.have.property('codec', 'dag-pb') + expect(cid).to.have.property('version', 0) + expect(cid).to.have.property('multihash').that.eql(mh) - expect(cid.toBaseEncodedString()).to.be.eql(mhStr) + expect(cid.toBaseEncodedString()).to.be.eql(mhStr) + done() + }) }) it('create by parts', () => {