mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-26 11:21:30 +01:00
Merge main into proxy branch (formatting and docs)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { describe, expect, it } from "vite-plus/test";
|
||||
|
||||
describe('template-function-faker', () => {
|
||||
it('exports all expected template functions', async () => {
|
||||
const { plugin } = await import('../src/index');
|
||||
describe("template-function-faker", () => {
|
||||
it("exports all expected template functions", async () => {
|
||||
const { plugin } = await import("../src/index");
|
||||
const names = plugin.templateFunctions?.map((fn) => fn.name).sort() ?? [];
|
||||
|
||||
// Snapshot the full list of exported function names so we catch any
|
||||
@@ -10,12 +10,13 @@ describe('template-function-faker', () => {
|
||||
expect(names).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('renders date results as unquoted ISO strings', async () => {
|
||||
const { plugin } = await import('../src/index');
|
||||
const fn = plugin.templateFunctions?.find((fn) => fn.name === 'faker.date.future');
|
||||
it("renders date results as unquoted ISO strings", async () => {
|
||||
const { plugin } = await import("../src/index");
|
||||
const fn = plugin.templateFunctions?.find((fn) => fn.name === "faker.date.future");
|
||||
// oxlint-disable-next-line unbound-method
|
||||
const onRender = fn?.onRender;
|
||||
|
||||
expect(onRender).toBeTypeOf('function');
|
||||
expect(onRender).toBeTypeOf("function");
|
||||
if (onRender == null) {
|
||||
throw new Error("Expected template function 'faker.date.future' to define onRender");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user