feat: restore gateway HMR and add WRN formatting
This commit is contained in:
@@ -58,5 +58,19 @@ try {
|
||||
bad("compiler bundle loads", e.message);
|
||||
}
|
||||
|
||||
// 4. Formatter normalizes nested WRN blocks and is idempotent.
|
||||
try {
|
||||
const { formatWrn } = require(join(root, "src/formatter.js"));
|
||||
const source = `page Home {\nview {\n<main>\n<h1>Hello</h1>\n</main>\n}\n}\n`;
|
||||
const expected = `page Home {\n view {\n <main>\n <h1>Hello</h1>\n </main>\n }\n}\n`;
|
||||
const formatted = formatWrn(source, { insertSpaces: true, tabSize: 2 });
|
||||
formatted === expected ? ok("formatter indents WRN blocks") : bad("formatter indents WRN blocks");
|
||||
formatWrn(formatted, { insertSpaces: true, tabSize: 2 }) === formatted
|
||||
? ok("formatter is idempotent")
|
||||
: bad("formatter is idempotent");
|
||||
} catch (e) {
|
||||
bad("formatter loads", e.message);
|
||||
}
|
||||
|
||||
console.log(failures === 0 ? "\nAll extension checks passed." : `\n${failures} check(s) failed.`);
|
||||
process.exit(failures === 0 ? 0 : 1);
|
||||
|
||||
Reference in New Issue
Block a user