add renamed type
ADD
packages/@romejs/core/test-worker/a.js
+export async function fun1Async(ex) {
+ function delay(ms) {
+ return new Promise((resolve) => setTimeout(resolve, ms));
+ }
+
+ if (ex) {
+ await delay(300);
+ throw new Error(ex);
+ } else {
+ return 'Hello world';
+ }
+}
+
+export function fun1(ex) {
+ if (ex) {
+ throw new Error(ex);
+ } else {
+ return 'Hello world';
+ }
+}

ADD
packages/@romejs/core/test-worker/a.test.js
+import {test} from 'rome';
+import {fun1, fun1Async} from './a';
+
+test(
+ 'throws sucess',
+ (t) => {
+ t.throws(() => fun1('hello'));
+ },
+);
+
+test(
+ 'throwAsync1 success',
+ async (t) => {
+ await t.throwsAsync(async () => fun1Async('hello'));
+ },
+);
+
+test(
+ 'notThrows2 success',
+ (t) => {
+ t.notThrows(() => fun1());
+ },
+);
+
+test(
+ 'noThrowAsync2 success',
+ async (t) => {
+ t.notThrowsAsync(async () => fun1Async());
+ },
+);
+
+test(
+ 'regex success',
+ (t) => {
+ t.regex(fun1(), /hello/i);
+ },
+);
+
+test(
+ 'notRegex success',
+ (t) => {
+ t.notRegex(fun1(), /hello/);
+ },
+);
+
+test(
+ 'throws fail',
+ (t) => {
+ t.throws(() => fun1());
+ },
+);
+
+/*
+
+test('throwsAsync2 fail', async t => {
+ await t.throwsAsync(async() => fun1Async());
+});
+
+test('notThrows1 fail', t => {
+ t.notThrows(() => fun1('hello'));
+});
+
+test('noThrowAsync1 fail', async t => {
+ await t.notThrowsAsync(async() => await fun1Async('hello'))
+});
+
+test('regex fail', t => {
+ t.regex(fun1(), /hello/);
+})
+
+test('notRegex fail', t => {
+ t.notRegex(fun1(), /hello/i);
+})
+*/

MODIFY
packages/@romejs/js-formatter/builders/typescript/TSTemplateLiteralTypeAnnotation.ts
packages/@romejs/js-formatter/builders/typescript/TSTemplateLiteralTypeAnnotation.ts
*/
import {Token} from "../../tokens";
+import { Builder } from "@romejs/js-formatter";
+import { TSTemplateLiteralTypeAnnotation } from "@romejs/js-ast";
+import { escapeString } from "@romejs/string-escape";
-export default function TSTemplateLiteralTypeAnnotation(): Token {
- throw new Error("unimplemented");
+export default function TSTemplateLiteralTypeAnnotation(
+ builder:Builder,
+ node: TSTemplateLiteralTypeAnnotation
+): Token {
+ return escapeString(node.value, {quote: '`'});
}

add renamed type