Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete the unit tests for model components #859

Merged
merged 13 commits into from
Dec 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: improve comments
jialudev committed Dec 18, 2024
commit 597bea8e0df4b6378252e595bcb7bfe60ef50243
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ vi.mock('../../../packs/useFetchApi', () => ({
})
}),
json: () => {
// 根据不同的 URL 返回不同的模拟数据
// different url return different data
if (url === '/tags') {
return Promise.resolve({
data: {
@@ -43,7 +43,7 @@ vi.mock('../../../packs/useFetchApi', () => ({
error: { value: null }
})
}
// 默认返回空数据
// return empty data
return Promise.resolve({
data: { value: null },
error: { value: null }
Original file line number Diff line number Diff line change
@@ -23,7 +23,6 @@ vi.mock("../../../packs/csrfFetch", () => {
});
});

// 创建挂载函数
const createWrapper = (props = {}) => {
return mount(QuestionAnswer, {
props: {
3 changes: 0 additions & 3 deletions frontend/vite.config.js
Original file line number Diff line number Diff line change
@@ -29,7 +29,6 @@ function getHtmlEntryFiles(srcDir) {
return entry;
}

// 开发环境打包配置
const DEV_CONFIG = {
plugins: [vue()],
optimizeDeps: {
@@ -75,12 +74,10 @@ const DEV_CONFIG = {
vue: "vue/dist/vue.esm-bundler.js",
"@": path.resolve(__dirname, "src"),
},
// 优化模块解析
dedupe: ["vue"],
},
};

// 生产环境打包配置
const PROD_CONFIG = {
plugins: [vue()],
build: {