I'm currently trying to Test With Supertest in Authentication with Firebase. But it doesn't work and I didn't understand the problems with the code.
here is my code snippet
import supertest, { SuperTest, Test } from 'supertest';
import admin from '../../../src/routes/v1/auth/firebase';
const request: SuperTest<Test> = supertest(app);
const uid = 'helloWorld';
const Token = admin
.auth()
.createCustomToken(uid)
.then((customToken) => {
return customToken;
});
describe('POST /some-url', function() {
it('POST/userAuth', async (done) => {
const res = await request
.post('/v1/user/haha')
.set('Authorization', `bearer ${Token}`)
.send({
title: 'Some random text',
options: [
{ start: hello, end: world },
{ start: good, end: bye },
],
});
});
Please help me to figure out the problem?
Thanks in Advance :)
question from:
https://stackoverflow.com/questions/65873597/facing-issues-while-unit-testing-with-firebase 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…