diff --git a/test/main.ts b/test/main.ts index 83d90ee..4c26554 100644 --- a/test/main.ts +++ b/test/main.ts @@ -434,14 +434,17 @@ describe('fn', () => { it('composite', () => { const input = -`
+`before +
Hello [tada everynyan! 🎉] I'm @ai, A bot of misskey! https://github.com/syuilo/ai -
`; +
+after`; const output = [ + TEXT('before'), CENTER([ TEXT('Hello '), FN('tada', { }, [ @@ -452,11 +455,26 @@ https://github.com/syuilo/ai MENTION('ai', null, '@ai'), TEXT(', A bot of misskey!\n\n'), N_URL('https://github.com/syuilo/ai') - ]) + ]), + TEXT('after') ]; assert.deepStrictEqual(parse(input), output); }); +it('toString', () => { + const input = +`before +
+Hello [tada everynyan! 🎉] + +I'm @ai, A bot of misskey! + +https://github.com/syuilo/ai +
+after`; + assert.strictEqual(toString(parse(input)), input); +}); + describe('inspect', () => { it('replace text', () => { const input = 'good morning [tada everynyan!]';