mirror of
https://github.com/web-infra-dev/midscene.git
synced 2025-08-01 21:32:56 +00:00
36 lines
843 B
TypeScript
36 lines
843 B
TypeScript
import { AiAssert } from '@/ai-model';
|
|
import { getContextFromFixture } from 'tests/evaluation';
|
|
/* eslint-disable max-lines-per-function */
|
|
import { describe, expect, it, vi } from 'vitest';
|
|
|
|
vi.setConfig({
|
|
testTimeout: 180 * 1000,
|
|
hookTimeout: 30 * 1000,
|
|
});
|
|
|
|
describe('assert', () => {
|
|
it('todo pass', async () => {
|
|
const { context } = await getContextFromFixture('todo');
|
|
|
|
const {
|
|
content: { pass },
|
|
} = await AiAssert({
|
|
assertion: 'Three tasks have been added',
|
|
context,
|
|
});
|
|
expect(pass).toBe(true);
|
|
});
|
|
|
|
it('todo error', async () => {
|
|
const { context } = await getContextFromFixture('todo');
|
|
|
|
const {
|
|
content: { pass, thought },
|
|
} = await AiAssert({
|
|
assertion: 'There are four tasks in the task list',
|
|
context,
|
|
});
|
|
expect(pass).toBe(false);
|
|
});
|
|
});
|