@sprucelabs/spruce-cli
Version:
Command line interface for building Spruce skills.
41 lines (33 loc) • 1.17 kB
text/typescript
import { test, assert } from '@sprucelabs/test-utils'
import WatchAction from '../../../features/view/actions/WatchAction'
import CommandServiceImpl from '../../../services/CommandService'
import AbstractSkillTest from '../../../tests/AbstractSkillTest'
export default class WatchingSkillViewsTest extends AbstractSkillTest {
protected static skillCacheKey = 'views'
protected static oldBootExecute: any
private static action: WatchAction
protected static async beforeEach() {
await super.beforeEach()
this.action = this.Action('view', 'watch')
}
()
protected static async hasWatchSkillViewsEvent() {
assert.isFunction(this.action.execute)
}
()
protected static async shouldCallBoot() {
let wasHit = false
CommandServiceImpl.fakeCommand(
'SHOULD_WATCH_VIEWS=true MAXIMUM_LOG_PREFIXES_LENGTH=0 yarn boot',
{
code: 200,
callback: () => {
wasHit = true
},
}
)
void this.action.execute()
await this.wait(10)
assert.isTrue(wasHit)
}
}