UNPKG

rete-kit

Version:

Rete.js Kit ==== [![Made in Ukraine](https://img.shields.io/badge/made_in-ukraine-ffd700.svg?labelColor=0057b7)](https://stand-with-ukraine.pp.ua) [![Discord](https://img.shields.io/discord/1081223198055604244?color=%237289da&label=Discord)](https://disco

28 lines (19 loc) 708 B
import { describe, expect, it } from '@jest/globals' import { TemplateBuilder } from '../src/app/template-builder' describe('Template builder', () => { const template = new TemplateBuilder(['add', 'line']) it('single line', async () => { const code = await template.build(`import { /* [add] A, [/add] */ B, /* [skip] C [/skip] */} from 'pkg';`) expect(code).toEqual(`import { A, B } from 'pkg';\n`) }) it('multiline', async () => { const code = await template.build(` import { A } from 'pkg'; /* [skip] const a = new A() [/skip] */ /* [line] const b = new A() [/line] */ `) expect(code).toEqual(`\ import { A } from 'pkg'; const b = new A();\n`) }) })