UNPKG

@sprucelabs/spruce-cli

Version:

Command line interface for building Spruce skills.

30 lines (25 loc) 936 B
import { CliInterface } from '../types/cli.types' import AbstractCliTest from './AbstractCliTest' export default abstract class AbstractSkillTest extends AbstractCliTest { protected static skillDir: string protected static cli: CliInterface protected static skillCacheKey: string protected static async beforeAll() { if (!this.skillCacheKey) { throw new Error( "You must implement `protected static skillCacheKey = 'stores'`" ) } await super.beforeAll() await this.reInstallSkill() } protected static async beforeEach() { await super.beforeEach() this.cwd = this.skillDir this.cli = await this.Cli() } protected static async reInstallSkill(key = this.skillCacheKey) { this.cwd = this.skillDir = this.freshTmpDir() this.cli = await this.FeatureFixture().installCachedFeatures(key) } }