chore: remove GitHub Actions workflows, use Woodpecker CI exclusively

This commit is contained in:
张翔
2026-03-10 13:10:11 +08:00
parent 0a1adfc2a2
commit e8dffa4f05
82 changed files with 19565 additions and 101 deletions
+53
View File
@@ -0,0 +1,53 @@
import { initSentry } from './sentry';
describe('sentry', () => {
const originalEnv = process.env;
beforeEach(() => {
jest.resetModules();
process.env = { ...originalEnv };
console.error = jest.fn();
});
afterEach(() => {
process.env = originalEnv;
});
describe('initSentry', () => {
it('should not initialize Sentry in non-production environment', () => {
process.env.NODE_ENV = 'development';
process.env.NEXT_PUBLIC_SENTRY_DSN = 'test-dsn';
initSentry();
expect(console.error).not.toHaveBeenCalled();
});
it('should not initialize Sentry when DSN is not set', () => {
process.env.NODE_ENV = 'production';
process.env.NEXT_PUBLIC_SENTRY_DSN = '';
initSentry();
expect(console.error).not.toHaveBeenCalled();
});
it('should initialize Sentry in production with DSN', () => {
process.env.NODE_ENV = 'production';
process.env.NEXT_PUBLIC_SENTRY_DSN = 'https://test@sentry.io/123';
initSentry();
expect(console.error).not.toHaveBeenCalled();
});
it('should handle missing NODE_ENV gracefully', () => {
delete process.env.NODE_ENV;
process.env.NEXT_PUBLIC_SENTRY_DSN = 'https://test@sentry.io/123';
initSentry();
expect(console.error).not.toHaveBeenCalled();
});
});
});