-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathbrowser.js
43 lines (33 loc) · 942 Bytes
/
browser.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* eslint-env mocha */
'use strict'
const IPFSRepo = require('../src')
async function createTempRepo (options = {}) {
const date = Date.now().toString()
const repoPath = 'test-repo-for-' + date
const repo = new IPFSRepo(repoPath, options)
await repo.init({})
await repo.open()
return repo
}
describe('IPFS Repo Tests on the Browser', () => {
require('./options-test')
require('./migrations-test')(createTempRepo)
const repo = new IPFSRepo('myrepo')
before(async () => {
await repo.init({})
await repo.open()
})
after(async () => {
await repo.close()
})
require('./repo-test')(repo)
require('./blockstore-test')(repo)
require('./blockstore-utils-test')()
require('./datastore-test')(repo)
require('./keystore-test')(repo)
require('./config-test')(repo)
require('./api-addr-test')(repo)
require('./lock-test')(repo)
require('./pins-test')(repo)
require('./is-initialized')
})