From 32b07685a8978668e7a57709209db2c461c395b2 Mon Sep 17 00:00:00 2001 From: l3ops Date: Thu, 6 Oct 2022 10:50:19 +0200 Subject: [PATCH] fix the formatting --- .../tests/wasm/diagnosticPrinter.test.mjs | 143 +++++++++--------- 1 file changed, 68 insertions(+), 75 deletions(-) diff --git a/npm/js-api/tests/wasm/diagnosticPrinter.test.mjs b/npm/js-api/tests/wasm/diagnosticPrinter.test.mjs index 7b41e7cdc01..ab324853253 100644 --- a/npm/js-api/tests/wasm/diagnosticPrinter.test.mjs +++ b/npm/js-api/tests/wasm/diagnosticPrinter.test.mjs @@ -2,86 +2,79 @@ import { describe, expect, it } from "vitest"; import { DiagnosticPrinter } from "@rometools/wasm-nodejs"; describe("Rome WebAssembly DiagnosticPrinter", () => { - it("should format content", async () => { - const SOURCE_CODE = - `const variable = expr(); + it("should format content", async () => { + const SOURCE_CODE = `const variable = expr(); if(expr()) { statement(); }`; - const printer = new DiagnosticPrinter("file.js", SOURCE_CODE); + const printer = new DiagnosticPrinter("file.js", SOURCE_CODE); - printer.print({ - "advices": { - "advices": [], - }, - "category": "parse", - "description": "error description content", - "location": { - "path": { - "File": { - "PathAndId": { - "file_id": 0, - "path": "file.js", - }, - }, - }, - "source_code": null, - "span": [ - 31, - 37, - ], - }, - "message": [ - { - "content": "error message content", - "elements": [], - }, - ], - "severity": "Error", - "source": null, - "tags": [], - "verbose_advices": { - "advices": [], - }, - }); + printer.print({ + advices: { + advices: [], + }, + category: "parse", + description: "error description content", + location: { + path: { + File: { + PathAndId: { + file_id: 0, + path: "file.js", + }, + }, + }, + source_code: null, + span: [31, 37], + }, + message: [ + { + content: "error message content", + elements: [], + }, + ], + severity: "Error", + source: null, + tags: [], + verbose_advices: { + advices: [], + }, + }); - printer.print({ - "advices": { - "advices": [], - }, - "category": "parse", - "description": "error description content", - "location": { - "path": { - "File": { - "PathAndId": { - "file_id": 0, - "path": "file.js", - }, - }, - }, - "source_code": null, - "span": [ - 46, - 58, - ], - }, - "message": [ - { - "content": "error message content", - "elements": [], - }, - ], - "severity": "Error", - "source": null, - "tags": [], - "verbose_advices": { - "advices": [], - }, - }); + printer.print({ + advices: { + advices: [], + }, + category: "parse", + description: "error description content", + location: { + path: { + File: { + PathAndId: { + file_id: 0, + path: "file.js", + }, + }, + }, + source_code: null, + span: [46, 58], + }, + message: [ + { + content: "error message content", + elements: [], + }, + ], + severity: "Error", + source: null, + tags: [], + verbose_advices: { + advices: [], + }, + }); - const html = printer.finish(); - expect(html).toMatchSnapshot("HTML diagnostic");; - }); + const html = printer.finish(); + expect(html).toMatchSnapshot("HTML diagnostic"); + }); });