mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-09 22:14:29 +09:00
17 lines
494 B
TypeScript
17 lines
494 B
TypeScript
import { expect, test } from "vitest";
|
|
import {
|
|
getExpressionErrorMessages,
|
|
hasExpressionDiagnostics,
|
|
} from "./expression-validation";
|
|
|
|
test("returns only expression error messages", () => {
|
|
expect(getExpressionErrorMessages({ expression: "invalid {" })).not.toEqual(
|
|
[]
|
|
);
|
|
});
|
|
|
|
test("detects expression diagnostics", () => {
|
|
expect(hasExpressionDiagnostics({ expression: "invalid {" })).toBe(true);
|
|
expect(hasExpressionDiagnostics({ expression: '"value"' })).toBe(false);
|
|
});
|