From a3f6c458666665238e42bb173b6d76bb15877fd1 Mon Sep 17 00:00:00 2001 From: pany <939630029@qq.com> Date: Tue, 3 Dec 2024 13:57:57 +0800 Subject: [PATCH] =?UTF-8?q?wip:=20=E6=9B=B4=E6=96=B0=E5=8D=95=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/components/Notify.test.ts | 8 ++++---- vite.config.ts | 7 ++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/components/Notify.test.ts b/tests/components/Notify.test.ts index d3bd8402..f396eb21 100644 --- a/tests/components/Notify.test.ts +++ b/tests/components/Notify.test.ts @@ -1,5 +1,5 @@ import Notify from "@@/components/Notify/index.vue" -import NotifyList from "@@/components/Notify/List.vue" +import List from "@@/components/Notify/List.vue" import { shallowMount } from "@vue/test-utils" import { describe, expect, it } from "vitest" @@ -10,9 +10,9 @@ describe("notify", () => { }) }) -describe("notifyList", () => { +describe("list", () => { it("list 长度为 0", () => { - const wrapper = shallowMount(NotifyList, { + const wrapper = shallowMount(List, { props: { data: [] } @@ -20,7 +20,7 @@ describe("notifyList", () => { expect(wrapper.find("el-empty").exists()).toBe(true) }) it("list 长度不为 0", () => { - const wrapper = shallowMount(NotifyList, { + const wrapper = shallowMount(List, { props: { data: [ { diff --git a/vite.config.ts b/vite.config.ts index 46d54a05..c183338d 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -118,7 +118,12 @@ export default defineConfig(({ mode }) => { // Configuring Vitest: https://cn.vitest.dev/config test: { include: ["tests/**/*.test.{ts,js}"], - environment: "jsdom" + environment: "jsdom", + server: { + deps: { + inline: ["element-plus"] + } + } } } })