1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-07-25 21:24:50 +02:00
Files
misskey/packages/frontend/test/unit/aiscript/common.test.ts
かっこかり 9472e72678 enhance(frontend/test): frontend e2eをPlaywrightに移行 (#17682)
* enhance(frontend/test): frontend e2eをVitest Browser Modeに移行

* fix

* fix unit tests

* fix

* fix

* update playwright

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* perf

* Revert "perf"

This reverts commit e60e965c3c.

* fix
2026-07-08 20:58:02 +09:00

24 lines
696 B
TypeScript

/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { assertStringAndIsIn } from "@/aiscript/common.js";
import { values } from "@syuilo/aiscript";
import { describe, expect, test } from "vitest";
describe('AiScript common script', () => {
test('assertStringAndIsIn', () => {
expect(
() => assertStringAndIsIn(values.STR('a'), ['a', 'b'])
).not.toThrow();
expect(
() => assertStringAndIsIn(values.STR('c'), ['a', 'b'])
).toThrow('"c" is not in "a", "b"');
expect(() => assertStringAndIsIn(
values.STR('invalid'),
['left', 'center', 'right']
)).toThrow('"invalid" is not in "left", "center", "right"');
});
});