Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Commit

Permalink
fix: update tests to support go-ipfs automatic sharding
Browse files Browse the repository at this point in the history
  • Loading branch information
aschmahmann committed Oct 13, 2021
1 parent 751d360 commit 69832a6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import all from 'it-all'
import last from 'it-last'
import { expect } from 'aegir/utils/chai.js'

const SHARD_THRESHOLD = 1000
const SHARD_THRESHOLD = 2000
// Use this to help push the shard threshold over the go-ipfs defaults
// without just adding lots of files
const shardFilePadding = ''.padStart(100, '0')

class ExpectedError extends Error {

Expand Down Expand Up @@ -381,7 +384,7 @@ describe('files', function () {

for (let i = 0; i < SHARD_THRESHOLD + 1; i++) {
files.push({
path: `${dir}/file-${i}.txt`,
path: `${dir}/file-${shardFilePadding}-${i}.txt`,
content: data
})
}
Expand Down Expand Up @@ -419,7 +422,7 @@ describe('files', function () {

for (let i = 0; i < SHARD_THRESHOLD; i++) {
files.push({
path: `${dir}/file-${i}.txt`,
path: `${dir}/file-${shardFilePadding}-${i}.txt`,
content: data
})
}
Expand Down

0 comments on commit 69832a6

Please sign in to comment.