Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
DellaBitta committed Nov 4, 2024
1 parent 6f4f745 commit e1913e3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
14 changes: 9 additions & 5 deletions packages/installations/src/api/get-id-server-app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,27 @@

import { expect } from 'chai';
import { getId } from './get-id';
import { FAKE_INSTALLATIONS_ID, getFakeInstallations, getFakeServerApp } from '../testing/fake-generators';
import {
FAKE_INSTALLATIONS_ID,
getFakeInstallations,
getFakeServerApp
} from '../testing/fake-generators';

describe('getId-serverapp', () => {
it('getId with firebaseServerApp with authIdToken returns valid id', async() => {
const installationsAuthToken = "fakeToken";
it('getId with firebaseServerApp with authIdToken returns valid id', async () => {
const installationsAuthToken = 'fakeToken';
const serverApp = getFakeServerApp(installationsAuthToken);
const installations = getFakeInstallations(serverApp);
const fid = await getId(installations);
expect(fid).to.equal(FAKE_INSTALLATIONS_ID);
});
it('getId with firebaseServerApp without authIdToken throws', async() => {
it('getId with firebaseServerApp without authIdToken throws', async () => {
const serverApp = getFakeServerApp();
const installations = getFakeInstallations(serverApp);
let fails = false;
try {
await getId(installations);
} catch (e) {
} catch (e) {
console.error(e);
fails = true;
}
Expand Down
9 changes: 6 additions & 3 deletions packages/installations/src/api/get-token-server-app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@

import { expect, use } from 'chai';
import { getToken } from './get-token';
import { getFakeInstallations, getFakeServerApp } from '../testing/fake-generators';
import {
getFakeInstallations,
getFakeServerApp
} from '../testing/fake-generators';
import chaiAsPromised from 'chai-as-promised';

use(chaiAsPromised);

describe('getToken-serverapp', () => {
it('getToken with firebaseServerApp with authIdToken returns valid token', async () => {
const installationsAuthToken = "fakeToken.abc123";
const installationsAuthToken = 'fakeToken';
const serverApp = getFakeServerApp(installationsAuthToken);
const installations = getFakeInstallations(serverApp);
const token = await getToken(installations);
Expand All @@ -36,7 +39,7 @@ describe('getToken-serverapp', () => {
let fails = false;
try {
await getToken(installations);
} catch (e) {
} catch (e) {
fails = true;
}
expect(fails).to.be.true;
Expand Down

0 comments on commit e1913e3

Please sign in to comment.