Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/sxzz/ast-kit. A toolkit for easy Babel AST generation and manipulation. jsr.io/@sxzz/ast-kit
Something went wrong. Try again.
1234567891011121314151617181920212223242526import * as t from '@babel/types'import { describe, expect, test } from 'vitest'import { createStringLiteral, createTSLiteralType, createTSUnionType,} from '../src'
describe('create', () => { test('createStringLiteral', () => { expect(createStringLiteral('hello')).toEqual( expect.objectContaining(t.stringLiteral('hello')), ) })
test('createTSUnionType', () => { const union = [t.tsStringKeyword(), t.tsNumberKeyword()] expect(createTSUnionType(union)).toEqual(t.tsUnionType(union)) })
test('createTSUnionType', () => { const literal = t.booleanLiteral(true) expect(createTSLiteralType(literal)).toEqual(t.tsLiteralType(literal)) })})