Skip to content

Commit

Permalink
Cleanup revisions test.
Browse files Browse the repository at this point in the history
  • Loading branch information
saul-jb committed Mar 25, 2024
1 parent 12f8d27 commit 2cf6a4c
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions packages/daemon/test/modules/revisions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,15 @@ describe('revisions', () => {
})

it('rpc - it exports a revision (file)', async () => {
const { revisions: m, network, filesystem, groups, sigint, argv } = await create()
const { network, filesystem, groups, sigint, argv } = await create()
const group = await createGroup(groups, 'test')
const r = m.getRevisions(group)
const fs = filesystem.getFileSystem(group)
const path = '/test'
const client = createNetClient(argv.socket)
const sequence = 0
const inFile = Path.join(dataPath, 'file-1.txt')
const outFile = Path.join(testPath, 'file-1.txt')

assert(r != null)
assert(fs != null)

const [{ cid }] = await all(importer(network.helia.blockstore, inFile, {
Expand All @@ -229,10 +227,6 @@ describe('revisions', () => {
priority: 1
}])

const entry = await fs.get(path)

assert(entry != null)

await promise

await new Promise(resolve => setTimeout(resolve, 100))
Expand All @@ -258,9 +252,8 @@ describe('revisions', () => {
})

it('rpc - it exports a revision (directory)', async () => {
const { revisions: m, network, filesystem, groups, sigint, argv } = await create()
const { network, filesystem, groups, sigint, argv } = await create()
const group = await createGroup(groups, 'test')
const r = m.getRevisions(group)
const fs = filesystem.getFileSystem(group)
const rootPath = '/test'
const client = createNetClient(argv.socket)
Expand All @@ -277,7 +270,6 @@ describe('revisions', () => {
virtual: Path.join(rootPath, path)
}))

assert(r != null)
assert(fs != null)

for (const path of paths) {
Expand Down Expand Up @@ -328,15 +320,13 @@ describe('revisions', () => {
})

it('rpc - lists a revision (file)', async () => {
const { revisions: m, network, filesystem, groups, sigint, argv } = await create()
const { network, filesystem, groups, sigint, argv } = await create()
const group = await createGroup(groups, 'test')
const r = m.getRevisions(group)
const fs = filesystem.getFileSystem(group)
const path = '/test'
const client = createNetClient(argv.socket)
const inFile = Path.join(dataPath, 'file-1.txt')

assert(r != null)
assert(fs != null)

const [{ cid }] = await all(importer(network.helia.blockstore, inFile, {
Expand All @@ -360,10 +350,6 @@ describe('revisions', () => {
priority: 1
}])

const entry = await fs.get(path)

assert(entry != null)

await promise

await new Promise(resolve => setTimeout(resolve, 100))
Expand All @@ -390,9 +376,8 @@ describe('revisions', () => {
})

it('rpc - it lists a revision (directory)', async () => {
const { revisions: m, network, filesystem, groups, sigint, argv } = await create()
const { network, filesystem, groups, sigint, argv } = await create()
const group = await createGroup(groups, 'test')
const r = m.getRevisions(group)
const fs = filesystem.getFileSystem(group)
const rootPath = '/test'
const client = createNetClient(argv.socket)
Expand All @@ -409,7 +394,6 @@ describe('revisions', () => {
cid: CID.parse('QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN')
}))

assert(r != null)
assert(fs != null)

const before = Date.now()
Expand Down

0 comments on commit 2cf6a4c

Please sign in to comment.