Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

fix(ci): avoid fs clash during ipfs.add* on Windows #523

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/files-regular/add-from-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict'

const { getDescribe, getIt, expect } = require('../utils/mocha')
const parallel = require('async/parallel')
const series = require('async/series')
const { echoUrl, redirectUrl } = require('../utils/echo-http-server')

module.exports = (createCommon, options) => {
Expand Down Expand Up @@ -34,7 +34,7 @@ module.exports = (createCommon, options) => {
it('should add from a HTTP URL', (done) => {
const text = `TEST${Date.now()}`
const url = echoUrl(text)
parallel({
series({
result: (cb) => ipfs.addFromURL(url, cb),
expectedResult: (cb) => ipfs.add(Buffer.from(text), cb)
}, (err, { result, expectedResult }) => {
Expand All @@ -52,7 +52,7 @@ module.exports = (createCommon, options) => {
const text = `TEST${Date.now()}`
const url = echoUrl(text) + '?foo=bar#buzz'

parallel({
series({
result: (cb) => ipfs.addFromURL(redirectUrl(url), cb),
expectedResult: (cb) => ipfs.add(Buffer.from(text), cb)
}, (err, { result, expectedResult }) => {
Expand Down Expand Up @@ -91,7 +91,7 @@ module.exports = (createCommon, options) => {
const filename = `TEST${Date.now()}.txt` // also acts as data
const url = echoUrl(filename) + '?foo=bar#buzz'
const addOpts = { wrapWithDirectory: true }
parallel({
series({
result: (cb) => ipfs.addFromURL(url, addOpts, cb),
expectedResult: (cb) => ipfs.add([{ path: filename, content: Buffer.from(filename) }], addOpts, cb)
}, (err, { result, expectedResult }) => {
Expand All @@ -107,7 +107,7 @@ module.exports = (createCommon, options) => {
const filename = `320px-Domažlice,_Jiráskova_43_(${Date.now()}).jpg` // also acts as data
const url = echoUrl(filename) + '?foo=bar#buzz'
const addOpts = { wrapWithDirectory: true }
parallel({
series({
result: (cb) => ipfs.addFromURL(url, addOpts, cb),
expectedResult: (cb) => ipfs.add([{ path: filename, content: Buffer.from(filename) }], addOpts, cb)
}, (err, { result, expectedResult }) => {
Expand Down