jest.setup.js 559 B

12345678910111213141516171819202122232425262728
  1. // Mock WatermelonDB
  2. jest.mock('@nozbe/watermelondb', () => ({
  3. Model: jest.fn(),
  4. Database: jest.fn(),
  5. Q: {
  6. where: jest.fn(),
  7. },
  8. field: jest.fn(),
  9. date: jest.fn(),
  10. relation: jest.fn(),
  11. children: jest.fn(),
  12. }));
  13. // Mock SQLite adapter
  14. jest.mock('@nozbe/watermelondb/adapters/sqlite', () => ({
  15. SQLiteAdapter: jest.fn(),
  16. }));
  17. // Global test setup
  18. global.console = {
  19. ...console,
  20. // Uncomment to ignore a specific log level
  21. // log: jest.fn(),
  22. // debug: jest.fn(),
  23. // info: jest.fn(),
  24. // warn: jest.fn(),
  25. // error: jest.fn(),
  26. };