service-core/test/providers/static.test.mjs
2022-01-28 07:03:18 +00:00

30 lines
950 B
JavaScript

import { Eltro as t, assert, stub } from 'eltro'
import StaticProvider from '../../core/providers/static.mjs'
t.describe('#getLatestVersion()', function() {
t.test('should return static result', async function() {
let provider = new StaticProvider({})
let version = await provider.getLatestVersion()
assert.strictEqual(version.version, 'static')
assert.strictEqual(version.link, '')
assert.strictEqual(version.filename, '')
assert.strictEqual(version.log, '')
})
})
t.describe('#downloadVersion()', function() {
t.test('should return an error', async function() {
let provider = new StaticProvider({})
let err = await assert.isRejected(provider.downloadVersion({}))
assert.match(err.message, /static/i)
assert.match(err.message, /support/i)
})
})
t.describe('#checkConfig()', function() {
t.test('should always succeed', async function() {
await new StaticProvider({}).checkConfig()
})
})