feat: 增加测试覆盖率并优化代码质量
test: 添加单元测试和端到端测试 refactor: 重构登录页面和上传模块 ci: 更新测试覆盖率阈值至42% build: 添加测试相关依赖 docs: 更新测试文档 style: 修复代码格式问题
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import '@testing-library/jest-dom';
|
||||
|
||||
jest.mock('./GoogleAnalytics', () => ({
|
||||
GoogleAnalytics: () => null,
|
||||
}));
|
||||
|
||||
jest.mock('./web-vitals', () => ({
|
||||
WebVitals: () => null,
|
||||
}));
|
||||
|
||||
describe('Analytics Components', () => {
|
||||
it('should export GoogleAnalytics', () => {
|
||||
const { GoogleAnalytics } = require('./GoogleAnalytics');
|
||||
expect(GoogleAnalytics).toBeDefined();
|
||||
});
|
||||
|
||||
it('should export WebVitals', () => {
|
||||
const { WebVitals } = require('./web-vitals');
|
||||
expect(WebVitals).toBeDefined();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user