UNPKG

@sprucelabs/spruce-cli

Version:

Command line interface for building Spruce skills.

52 lines 2.67 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const test_utils_1 = require("@sprucelabs/test-utils"); const AbstractCliTest_1 = __importDefault(require("../../tests/AbstractCliTest")); const introspection_utility_1 = __importDefault(require("../../utilities/introspection.utility")); class IntrospectionTest extends AbstractCliTest_1.default { static doesntCrashWithBadFiles() { const path = this.resolveTestPath('introspection/BadDefinition.ts'); const results = introspection_utility_1.default.introspect([path]); test_utils_1.assert.isEqualDeep(results, [{ classes: [], interfaces: [] }]); } static canIntrospectClassThatHasNoParentButImplementsInterface() { const path = this.resolveTestPath('introspection/ImplementsInterface.ts'); const results = introspection_utility_1.default.introspect([path]); const classPath = this.resolveTestPath('introspection/ImplementsInterface.ts'); test_utils_1.assert.isEqualDeep(results, [ { classes: [ { classPath, className: 'ImplementsInterface', isAbstract: false, optionsInterfaceName: undefined, parentClassName: undefined, parentClassPath: undefined, staticProperties: { name: 'test', }, }, ], interfaces: [{ interfaceName: 'TestInterface' }], }, ]); } } exports.default = IntrospectionTest; __decorate([ (0, test_utils_1.test)() ], IntrospectionTest, "doesntCrashWithBadFiles", null); __decorate([ (0, test_utils_1.test)() ], IntrospectionTest, "canIntrospectClassThatHasNoParentButImplementsInterface", null); //# sourceMappingURL=Introspection.test.js.map