Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into shared-worker
Browse files Browse the repository at this point in the history
  • Loading branch information
Gozala committed Jun 18, 2020
2 parents 2bf80b2 + 5cbba95 commit 3511641
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ stages:
- test-external

node_js:
- '10'
- '12'
- 'lts/*'
- 'node'

os:
- linux
Expand Down
2 changes: 1 addition & 1 deletion docs/core-api/FILES.md
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ console.log(Buffer.concat(chunks).toString())

| Name | Type | Description |
| ---- | ---- | ----------- |
| path | `String` or `Array<String>` | One or more [MFS path][]s to remove |
| path | `String` | The [MFS path] where you will write to |
| content | `String`, `Buffer`, `AsyncIterable<Buffer>` or [`Blob`][blob] | The content to write to the path |

#### Options
Expand Down
15 changes: 8 additions & 7 deletions packages/interface-ipfs-core/src/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const concat = require('it-concat')
const drain = require('it-drain')
const { getDescribe, getIt, expect } = require('./utils/mocha')
const testTimeout = require('./utils/test-timeout')
const importer = require('ipfs-unixfs-importer')

/** @typedef { import("ipfsd-ctl/src/factory") } Factory */
/**
Expand All @@ -26,8 +27,8 @@ module.exports = (common, options) => {

before(async () => {
ipfs = (await common.spawn()).api
await all(ipfs.add(fixtures.smallFile.data))
await all(ipfs.add(fixtures.bigFile.data))
await all(importer([{ content: fixtures.smallFile.data }], ipfs.block))
await all(importer([{ content: fixtures.bigFile.data }], ipfs.block))
})

after(() => common.clean())
Expand Down Expand Up @@ -57,7 +58,7 @@ module.exports = (common, options) => {
it('should get a file added as CIDv0 with a CIDv1', async () => {
const input = Buffer.from(`TEST${Math.random()}`)

const res = await all(ipfs.add(input, { cidVersion: 0 }))
const res = await all(importer([{ content: input }], ipfs.block))

const cidv0 = res[0].cid
expect(cidv0.version).to.equal(0)
Expand All @@ -71,7 +72,7 @@ module.exports = (common, options) => {
it('should get a file added as CIDv1 with a CIDv0', async () => {
const input = Buffer.from(`TEST${Math.random()}`)

const res = await all(ipfs.add(input, { cidVersion: 1, rawLeaves: false }))
const res = await all(importer([{ content: input }], ipfs.block, { cidVersion: 1, rawLeaves: false }))

const cidv1 = res[0].cid
expect(cidv1.version).to.equal(1)
Expand Down Expand Up @@ -110,7 +111,7 @@ module.exports = (common, options) => {
emptyDir('files/empty')
]

const res = await all(ipfs.add(dirs))
const res = await all(importer(dirs, ipfs.block))
const root = res[res.length - 1]

expect(root.path).to.equal('test-folder')
Expand Down Expand Up @@ -161,7 +162,7 @@ module.exports = (common, options) => {
content: fixtures.smallFile.data
}

for await (const fileAdded of ipfs.add(file)) {
for await (const fileAdded of importer([file], ipfs.block)) {
if (fileAdded.path === 'a') {
const files = await all(ipfs.get(`/ipfs/${fileAdded.cid.toString()}/testfile.txt`))
expect(files).to.be.length(1)
Expand All @@ -176,7 +177,7 @@ module.exports = (common, options) => {
content: fixtures.smallFile.data
}

const filesAdded = await all(ipfs.add([file]))
const filesAdded = await all(importer([file], ipfs.block))

filesAdded.forEach(async (file) => {
if (file.path === 'a') {
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs/.aegir.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let sigServerB
let ipfsdServer

module.exports = {
bundlesize: { maxSize: '446kB' },
bundlesize: { maxSize: '460kB' },
karma: {
files: [{
pattern: 'node_modules/interface-ipfs-core/test/fixtures/**/*',
Expand Down

0 comments on commit 3511641

Please sign in to comment.