diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 00000000..de3e3780 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,23 @@ +environment: + matrix: + - nodejs_version: "6" + - nodejs_version: "8" + +# cache: +# - node_modules + +platform: + - x64 + +install: + - ps: Install-Product node $env:nodejs_version $env:platform + - npm install + +test_script: + - node --version + - npm --version + - npm test + +build: off + +version: "{build}" diff --git a/.gitignore b/.gitignore index bad26fff..7cc5c2dd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +yarn.lock +package-lock.json + test/test-repo-for* # Logs diff --git a/.travis.yml b/.travis.yml index 5cc672b8..c5ed64e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,23 +3,16 @@ language: node_js matrix: include: - - node_js: 4 - env: CXX=g++-4.8 - node_js: 6 - env: - - CXX=g++-4.8 - - node_js: stable env: CXX=g++-4.8 - -# Make sure we have new NPM. -before_install: - - npm install -g npm@4 + - node_js: 8 + env: CXX=g++-4.8 + # - node_js: stable + # env: CXX=g++-4.8 script: - npm run lint - - npm test - - npm run coverage - - make test + - npm run test before_script: - export DISPLAY=:99.0 diff --git a/circle.yml b/circle.yml index 56f7efbe..d67b6ae7 100644 --- a/circle.yml +++ b/circle.yml @@ -2,6 +2,10 @@ machine: node: version: stable +test: + post: + - npm run coverage -- --upload + dependencies: pre: - google-chrome --version diff --git a/package.json b/package.json index 2d47c69f..54103c8c 100644 --- a/package.json +++ b/package.json @@ -11,17 +11,17 @@ "./src/default-options.js": "./src/default-options-browser.js" }, "scripts": { - "test": "aegir-test", - "test:node": "aegir-test node", - "test:browser": "aegir-test browser", - "build": "aegir-build", - "lint": "aegir-lint", - "release": "aegir-release --docs", - "release-minor": "aegir-release --type minor --docs", - "release-major": "aegir-release --type major --docs", - "coverage": "aegir-coverage", - "coverage-publish": "aegir-coverage publish", - "docs": "aegir-docs" + "test": "aegir test", + "test:node": "aegir test --target node", + "test:browser": "aegir test --target browser", + "build": "aegir build", + "lint": "aegir lint", + "release": "aegir release --docs", + "release-minor": "aegir release --type minor --docs", + "release-major": "aegir release --type major --docs", + "coverage": "aegir coverage", + "coverage-publish": "aegir-coverage --provider coveralls", + "docs": "aegir docs" }, "repository": { "type": "git", @@ -38,37 +38,37 @@ ], "homepage": "https://github.com/ipfs/js-ipfs-repo", "engines": { - "node": ">=4.0.0", + "node": ">=6.0.0", "npm": ">=3.0.0" }, "devDependencies": { - "aegir": "^11.0.2", - "chai": "^4.1.0", + "aegir": "^12.1.3", + "chai": "^4.1.2", "dirty-chai": "^2.0.1", "lodash": "^4.17.4", - "memdown": "^1.2.4", - "multihashes": "~0.4.5", + "memdown": "^1.4.1", + "multihashes": "~0.4.12", "ncp": "^2.0.0", "pre-commit": "^1.2.2", - "rimraf": "^2.6.1" + "rimraf": "^2.6.2" }, "dependencies": { "async": "^2.5.0", - "base32.js": "^0.1.0", - "cids": "^0.5.1", - "interface-datastore": "^0.3.0", - "datastore-core": "^0.3.0", - "datastore-fs": "^0.3.0", - "datastore-level": "^0.6.0", - "debug": "^2.6.8", + "base32.js": "~0.1.0", + "cids": "~0.5.2", + "interface-datastore": "~0.4.0", + "datastore-core": "~0.4.0", + "datastore-fs": "~0.4.0", + "datastore-level": "~0.6.0", + "debug": "^3.1.0", "ipfs-block": "~0.6.0", "level-js": "timkuijsten/level.js#idbunwrapper", "leveldown": "^1.7.2", - "lock-me": "^1.0.2", + "lock-me": "^1.0.3", "lodash.get": "^4.4.2", "lodash.has": "^4.5.2", "lodash.set": "^4.3.2", - "safe-buffer": "^5.1.1" + "multiaddr": "^3.0.1" }, "license": "MIT", "contributors": [ diff --git a/src/version.js b/src/version.js index ab152cfe..788f502e 100644 --- a/src/version.js +++ b/src/version.js @@ -39,7 +39,7 @@ module.exports = (store) => { * @returns {void} */ set (version, callback) { - store.put(versionKey, new Buffer(String(version)), callback) + store.put(versionKey, Buffer.from(String(version)), callback) }, /** * Check the current version, and return an error on missmatch diff --git a/test/datastore-test.js b/test/datastore-test.js index 881e7e34..cba5bd20 100644 --- a/test/datastore-test.js +++ b/test/datastore-test.js @@ -13,8 +13,8 @@ const Key = require('interface-datastore').Key module.exports = (repo) => { describe('datastore', () => { - const dataList = _.range(100).map((i) => new Buffer(`hello-${i}-${Math.random()}`)) - const data = new Buffer('hello world') + const dataList = _.range(100).map((i) => Buffer.from(`hello-${i}-${Math.random()}`)) + const data = Buffer.from('hello world') const b = new Key('hello') describe('.put', () => { diff --git a/test/interop-test.js b/test/interop-test.js index 7c4181b4..21feaec7 100644 --- a/test/interop-test.js +++ b/test/interop-test.js @@ -18,11 +18,7 @@ module.exports = (repo) => { repo.blocks.get(new CID(welcomeHash), (err, val) => { expect(err).to.not.exist() - expect( - val.data.toString() - ).to.match( - /Hello and Welcome to IPFS/ - ) + expect(val.data.toString()).to.match(/Hello and Welcome to IPFS/) done() }) }) @@ -36,7 +32,7 @@ module.exports = (repo) => { map(cids, repo.blocks.get, (err, values) => { expect(err).to.not.exist() expect(values.length).to.equal(2) - expect(values.map(value => value.data.length)).to.deep.equal([2659, 12783]) + expect(values.map((value) => value.data.length)).to.eql([2659, 12783]) done() }) }) @@ -44,7 +40,7 @@ module.exports = (repo) => { it('reads pin set from the datastore', (done) => { repo.datastore.get(new Key('/local/pins'), (err, val) => { expect(err).to.not.exist() - expect(mh.toB58String(val)).to.be.equal('QmYAuyf2LzMba65NnhxLtGJxixKNUev9qYSu4MYM88hdwK') + expect(mh.toB58String(val)).to.equal('QmYAuyf2LzMba65NnhxLtGJxixKNUev9qYSu4MYM88hdwK') done() }) }) @@ -52,7 +48,7 @@ module.exports = (repo) => { it('reads DHT records from the datastore', (done) => { repo.datastore.get(new Key('/AHE5I5B7TY'), (err, val) => { expect(err).to.not.exist() - expect(val.toString('hex')).to.deep.equal('0a0601c9d4743f9e12097465737476616c75651a2212201d22e2a5e140e5cd20d88fc59cd560f4887c7d9acf938ddb24d7207eac40fd2f') + expect(val.toString('hex')).to.eql('0a0601c9d4743f9e12097465737476616c75651a2212201d22e2a5e140e5cd20d88fc59cd560f4887c7d9acf938ddb24d7207eac40fd2f') done() }) })