Testing¶
Test your TruSpace changes.
Running Tests¶
Backend Tests¶
Frontend Tests¶
Writing Tests¶
Unit Tests¶
Use Jest for unit testing:
describe('MyService', () => {
it('should do something', () => {
expect(result).toBe(expected);
});
});
Integration Tests¶
Test API endpoints with supertest:
import request from 'supertest';
describe('GET /api/workspaces', () => {
it('returns workspaces', async () => {
const res = await request(app)
.get('/api/workspaces')
.set('Authorization', `Bearer ${token}`);
expect(res.status).toBe(200);
});
});
E2E Tests¶
Playwright tests in e2e-tests/: