@sprucelabs/spruce-cli
Version:
Command line interface for building Spruce skills.
43 lines (39 loc) • 1.54 kB
text/typescript
import { test, assert } from '@sprucelabs/test-utils'
import AbstractCliTest from '../../tests/AbstractCliTest'
import introspectionUtil from '../../utilities/introspection.utility'
export default class IntrospectionTest extends AbstractCliTest {
()
protected static doesntCrashWithBadFiles() {
const path = this.resolveTestPath('introspection/BadDefinition.ts')
const results = introspectionUtil.introspect([path])
assert.isEqualDeep(results, [{ classes: [], interfaces: [] }])
}
()
protected static canIntrospectClassThatHasNoParentButImplementsInterface() {
const path = this.resolveTestPath(
'introspection/ImplementsInterface.ts'
)
const results = introspectionUtil.introspect([path])
const classPath = this.resolveTestPath(
'introspection/ImplementsInterface.ts'
)
assert.isEqualDeep(results, [
{
classes: [
{
classPath,
className: 'ImplementsInterface',
isAbstract: false,
optionsInterfaceName: undefined,
parentClassName: undefined,
parentClassPath: undefined,
staticProperties: {
name: 'test',
},
},
],
interfaces: [{ interfaceName: 'TestInterface' }],
},
])
}
}