Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

605 B
Raw Blame
import { expect, test } from 'vitest';

import { constDeclaration } from './ConstDeclaration';
import { docComment } from './DocComment';
import { namedType } from './NamedType';
import { stringify } from './stringify';

const A = namedType('A');

test('basic', () => {
  expect(stringify(constDeclaration('B', A))).toMatchInlineSnapshot(`"const B: A"`);
});

test('with doc comment', () => {
  const decl = constDeclaration('B', A).setDocComment(docComment('Some important value'));
  expect(stringify(decl)).toMatchInlineSnapshot(`
    "/**
     * Some important value
     */
    const B: A"
  `);
});