mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
* remove optional fetch method, add abort signal * fix encrypt * fix encrypt * fix lint,tests * test * fix adr * test * fix asset * t * t
30 lines
930 B
TypeScript
30 lines
930 B
TypeScript
import { Provider } from '../../src/provider/Provider'
|
|
import { assert } from 'chai'
|
|
import { FileMetadata } from '../../src/@types'
|
|
|
|
describe('Provider tests', () => {
|
|
let providerInstance: Provider
|
|
|
|
it('Initialize Ocean', async () => {
|
|
providerInstance = new Provider()
|
|
})
|
|
|
|
it('Alice tests invalid provider', async () => {
|
|
const valid = await providerInstance.isValidProvider('http://example.net')
|
|
assert(valid === false)
|
|
})
|
|
|
|
it('Alice tests valid provider', async () => {
|
|
const valid = await providerInstance.isValidProvider('http://127.0.0.1:8030')
|
|
assert(valid === true)
|
|
})
|
|
|
|
it('Alice checks fileinfo', async () => {
|
|
const fileinfo: FileMetadata[] = await providerInstance.checkFileUrl(
|
|
'https://dumps.wikimedia.org/enwiki/latest/enwiki-latest-abstract.xml.gz-rss.xml',
|
|
'http://127.0.0.1:8030'
|
|
)
|
|
assert(fileinfo[0].valid === true, 'Sent file is not valid')
|
|
})
|
|
})
|