Skip to content

Commit

Permalink
test: move test file data to fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Feb 24, 2023
1 parent e973120 commit 1b76084
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions test/cat.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import toBuffer from 'it-to-buffer'
import drain from 'it-drain'
import { importDirectory, importBytes } from 'ipfs-unixfs-importer'
import { createShardedDirectory } from './fixtures/create-sharded-directory.js'

const smallFile = Uint8Array.from(new Array(13).fill(0).map(() => Math.random() * 100))
import { smallFile } from './fixtures/files.js'

describe('cat', () => {
let blockstore: Blockstore
Expand Down
3 changes: 1 addition & 2 deletions test/chmod.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import { UnixFS, unixfs } from '../src/index.js'
import type { CID } from 'multiformats/cid'
import { importDirectory, importBytes } from 'ipfs-unixfs-importer'
import { createShardedDirectory } from './fixtures/create-sharded-directory.js'

const smallFile = Uint8Array.from(new Array(13).fill(0).map(() => Math.random() * 100))
import { smallFile } from './fixtures/files.js'

describe('chmod', () => {
let blockstore: Blockstore
Expand Down
4 changes: 4 additions & 0 deletions test/fixtures/files.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

export const largeFile = Uint8Array.from(new Array(490668).fill(0).map(() => Math.random() * 100))

export const smallFile = Uint8Array.from(new Array(13).fill(0).map(() => Math.random() * 100))
3 changes: 1 addition & 2 deletions test/rm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import { importDirectory, importBytes, importer } from 'ipfs-unixfs-importer'
import { createShardedDirectory } from './fixtures/create-sharded-directory.js'
import last from 'it-last'
import { createSubshardedDirectory } from './fixtures/create-subsharded-directory.js'

const smallFile = Uint8Array.from(new Array(13).fill(0).map(() => Math.random() * 100))
import { smallFile } from './fixtures/files.js'

describe('rm', () => {
let blockstore: Blockstore
Expand Down
4 changes: 1 addition & 3 deletions test/stat.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import type { CID } from 'multiformats/cid'
import * as dagPb from '@ipld/dag-pb'
import { importDirectory, importBytes, importFile } from 'ipfs-unixfs-importer'
import { createShardedDirectory } from './fixtures/create-sharded-directory.js'

const smallFile = Uint8Array.from(new Array(13).fill(0).map(() => Math.random() * 100))
const largeFile = Uint8Array.from(new Array(490668).fill(0).map(() => Math.random() * 100))
import { largeFile, smallFile } from './fixtures/files.js'

describe('stat', function () {
this.timeout(120 * 1000)
Expand Down

0 comments on commit 1b76084

Please sign in to comment.