diff --git a/src/proxy/_utils.ts b/src/proxy/_utils.ts index 3440826..d3a596e 100644 --- a/src/proxy/_utils.ts +++ b/src/proxy/_utils.ts @@ -51,7 +51,7 @@ export function literalToAst(value: any): ESNode { } if (value === null) { // eslint-disable-next-line unicorn/no-null - return recast.types.builders.literal(null) as any; + return recast.types.builders.literal(null) as any; } if (Array.isArray(value)) { return recast.types.builders.arrayExpression( diff --git a/test/utils.test.ts b/test/utils.test.ts index bb3fdec..bcf66fc 100644 --- a/test/utils.test.ts +++ b/test/utils.test.ts @@ -2,22 +2,22 @@ import { describe, it, expect } from "vitest"; import { print } from "recast"; import { literalToAst } from "../src/proxy/_utils"; -describe('literalToAst', () => { +describe("literalToAst", () => { // eslint-disable-next-line unicorn/consistent-function-scoping function run(value: any) { return print(literalToAst(value)).code; } - - it('should work', () => { - expect(run(1)).toMatchInlineSnapshot('"1"') - expect(run(true)).toMatchInlineSnapshot('"true"') - expect(run(undefined)).toMatchInlineSnapshot('"undefined"') + + it("should work", () => { + expect(run(1)).toMatchInlineSnapshot('"1"'); + expect(run(true)).toMatchInlineSnapshot('"true"'); + expect(run(undefined)).toMatchInlineSnapshot('"undefined"'); // eslint-disable-next-line unicorn/no-null - expect(run(null)).toMatchInlineSnapshot('"null"') - expect(run([undefined, 1, { foo:'bar' }])).toMatchInlineSnapshot(` + expect(run(null)).toMatchInlineSnapshot('"null"'); + expect(run([undefined, 1, { foo: "bar" }])).toMatchInlineSnapshot(` "[undefined, 1, { foo: \\"bar\\" }]" - `) - }) -}) + `); + }); +});