Files
Compass/backend/api/tests/unit/get-supabase-token.unit.test.ts
Martin Braquet ba9b3cfb06 Add pretty formatting (#29)
* Test

* Add pretty formatting

* Fix Tests

* Fix Tests

* Fix Tests

* Fix

* Add pretty formatting fix

* Fix

* Test

* Fix tests

* Clean typeckech

* Add prettier check

* Fix api tsconfig

* Fix api tsconfig

* Fix tsconfig

* Fix

* Fix

* Prettier
2026-02-20 17:32:27 +01:00

41 lines
1.7 KiB
TypeScript

jest.mock('jsonwebtoken')
describe.skip('getSupabaseToken', () => {
// const originalSupabaseJwtSecret = process.env.SUPABASE_JWT_SECRET
// const originalInstanceId = constants.ENV_CONFIG.supabaseInstanceId
// const originalProjectId = constants.ENV_CONFIG.firebaseConfig.projectId
// describe('should', () => {
// beforeEach(() => {
// jest.resetAllMocks();
// process.env.SUPABASE_JWT_SECRET = 'test-jwt-secret-123';
// constants.ENV_CONFIG.supabaseInstanceId = 'test-instance-id';
// constants.ENV_CONFIG.firebaseConfig.projectId = 'test-project-id';
// (jsonWebtokenModules.sign as jest.Mock).mockReturnValue('fake-jwt-token-abc123');
// });
// afterEach(() => {
// if (originalSupabaseJwtSecret === undefined) {
// delete process.env.SUPABASE_JWT_SECRET;
// } else {
// process.env.SUPABASE_JWT_SECRET = originalSupabaseJwtSecret;
// }
// constants.ENV_CONFIG.supabaseInstanceId = originalInstanceId;
// constants.ENV_CONFIG.firebaseConfig.projectId = originalProjectId;
// jest.restoreAllMocks();
// });
// it('successfully generate a JTW token with correct parameters', async () => {
// const mockParams = {} as any;
// const mockAuth = {uid: '321'} as AuthedUser;
// const result = await getSupabaseToken(mockParams, mockAuth, mockParams)
// expect(result).toEqual({
// jwt: 'fake-jwt-token-abc123'
// })
// })
// });
})
describe('getCompatibleProfiles', () => {
it('skip', async () => {
console.log('This needs tests')
})
})