@sprucelabs/spruce-cli
Version:
Command line interface for building Spruce skills.
33 lines (26 loc) • 1.02 kB
text/typescript
import { test, assert } from '@sprucelabs/test-utils'
import { errorAssert } from '@sprucelabs/test-utils'
import AbstractErrorTest from '../../../tests/AbstractErrorTest'
export default class SettingUpErrorTest extends AbstractErrorTest {
()
protected static async failsIfSkillIsNotInstalled() {
const fixture = this.FeatureFixture()
const err = await assert.doesThrowAsync(() =>
fixture.installFeatures([
{
code: 'error',
},
])
)
errorAssert.assertError(err, 'VALIDATION_FAILED')
}
()
protected static async installsSchemasIfNotInstalled() {
await this.installErrorFeature('errors')
const installer = this.featureInstaller
const isSchemaInstalled = await installer.isInstalled('schema')
assert.isTrue(isSchemaInstalled)
const isErrorInstalled = await installer.isInstalled('error')
assert.isTrue(isErrorInstalled)
}
}