Skip to content

Commit

Permalink
Basic tests for exportPackage function
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew committed May 10, 2021
1 parent c73c772 commit ce59763
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,17 @@ describe('fetchResponse', async function() {
assert.equal(body, false)
})
})

describe('exportPackages', async function() {
it('adds all packages to an mfs directory', async () => {
await db.clear()

await core.addUrltoIPFS(db, 'go', 'github.com/mr-tron/base58', 'v1.0.0', `https://proxy.golang.org/github.com/mr-tron/base58/@v/v1.0.0.zip`)

var stats = await core.exportPackages(db)

assert.equal(stats.blocks, 1)
assert.equal(stats.cumulativeSize, 13221)
assert.equal(stats.cid.toString(), 'bafybeigryrrcydhinskpju3vrsdnl7r57nakusl54cm6snc4o37djjhdu4')
})
})

0 comments on commit ce59763

Please sign in to comment.