summaryrefslogtreecommitdiff
path: root/packages/frontend/test/aiscript/api.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/frontend/test/aiscript/api.test.ts')
-rw-r--r--packages/frontend/test/aiscript/api.test.ts15
1 files changed, 9 insertions, 6 deletions
diff --git a/packages/frontend/test/aiscript/api.test.ts b/packages/frontend/test/aiscript/api.test.ts
index 34f880286c..292ec7ca77 100644
--- a/packages/frontend/test/aiscript/api.test.ts
+++ b/packages/frontend/test/aiscript/api.test.ts
@@ -8,7 +8,6 @@ import { aiScriptReadline, createAiScriptEnv } from '@/aiscript/api.js';
import { errors, Interpreter, Parser, values } from '@syuilo/aiscript';
import {
afterAll,
- afterEach,
beforeAll,
beforeEach,
describe,
@@ -80,8 +79,9 @@ describe('AiScript common API', () => {
});
describe('readline', () => {
- afterEach(() => {
+ beforeEach(() => {
vi.restoreAllMocks();
+ vi.clearAllMocks();
});
test.sequential('ok', async () => {
@@ -176,8 +176,9 @@ describe('AiScript common API', () => {
});
describe('dialog', () => {
- afterEach(() => {
+ beforeEach(() => {
vi.restoreAllMocks();
+ vi.clearAllMocks();
});
test.sequential('ok', async () => {
@@ -215,8 +216,9 @@ describe('AiScript common API', () => {
});
describe('confirm', () => {
- afterEach(() => {
+ beforeEach(() => {
vi.restoreAllMocks();
+ vi.clearAllMocks();
});
test.sequential('ok', async () => {
@@ -272,8 +274,9 @@ describe('AiScript common API', () => {
});
describe('api', () => {
- afterEach(() => {
+ beforeEach(() => {
vi.restoreAllMocks();
+ vi.clearAllMocks();
});
test.sequential('successful', async () => {
@@ -347,7 +350,7 @@ describe('AiScript common API', () => {
miLocalStorage.removeItem('aiscript:widget:key');
});
- afterEach(() => {
+ beforeEach(() => {
miLocalStorage.removeItem('aiscript:widget:key');
});