chore(deps): update dependency jest to v27

This commit is contained in:
Renovate Bot
2021-07-06 10:28:51 +00:00
committed by Mrugesh Mohapatra
parent fb3e9ef420
commit 7c2a4aff6e
8 changed files with 2911 additions and 2402 deletions

View File

@ -339,7 +339,7 @@ describe('boot/challenge', () => {
});
const mockNormalizeParams = params => params;
it('redirects to the learn base url for non-users', async done => {
it('redirects to the learn base url for non-users', async () => {
const redirectToCurrentChallenge = createRedirectToCurrentChallenge(
() => {},
mockNormalizeParams,
@ -351,11 +351,10 @@ describe('boot/challenge', () => {
await redirectToCurrentChallenge(req, res, next);
expect(res.redirect).toHaveBeenCalledWith(mockLearnUrl);
done();
});
// eslint-disable-next-line max-len
it('redirects to the url provided by the challengeUrlResolver', async done => {
it('redirects to the url provided by the challengeUrlResolver', async () => {
const challengeUrlResolver = await createChallengeUrlResolver(
mockAllChallenges,
{
@ -376,11 +375,10 @@ describe('boot/challenge', () => {
await redirectToCurrentChallenge(req, res, next);
expect(res.redirect).toHaveBeenCalledWith(expectedUrl);
done();
});
// eslint-disable-next-line max-len
it('redirects to the first challenge for users without a currentChallengeId', async done => {
it('redirects to the first challenge for users without a currentChallengeId', async () => {
const challengeUrlResolver = await createChallengeUrlResolver(
mockAllChallenges,
{
@ -400,7 +398,6 @@ describe('boot/challenge', () => {
await redirectToCurrentChallenge(req, res, next);
const expectedUrl = `${mockHomeLocation}${firstChallengeUrl}`;
expect(res.redirect).toHaveBeenCalledWith(expectedUrl);
done();
});
});
});

View File

@ -152,7 +152,7 @@ describe('request-authorization', () => {
expect(next).not.toHaveBeenCalled();
});
it('adds the user to the request object', async done => {
it('adds the user to the request object', async () => {
expect.assertions(3);
const validJWT = jwt.sign({ accessToken }, validJWTSecret);
const req = mockReq({
@ -166,10 +166,9 @@ describe('request-authorization', () => {
expect(next).toHaveBeenCalled();
expect(req).toHaveProperty('user');
expect(req.user).toEqual(users['456def']);
return done();
});
it('adds the jwt to the headers', async done => {
it('adds the jwt to the headers', async () => {
const validJWT = jwt.sign({ accessToken }, validJWTSecret);
const req = mockReq({
path: '/some-path/that-needs/auth',
@ -180,7 +179,6 @@ describe('request-authorization', () => {
const next = jest.fn();
await requestAuthorization(req, res, next);
expect(res.set).toHaveBeenCalledWith('X-fcc-access-token', validJWT);
return done();
});
it('calls next if request does not require authorization', async () => {
@ -240,7 +238,7 @@ describe('request-authorization', () => {
expect(next).not.toHaveBeenCalled();
});
it('adds the user to the request object', async done => {
it('adds the user to the request object', async () => {
expect.assertions(3);
const validJWT = jwt.sign({ accessToken }, validJWTSecret);
const req = mockReq({
@ -253,10 +251,9 @@ describe('request-authorization', () => {
expect(next).toHaveBeenCalled();
expect(req).toHaveProperty('user');
expect(req.user).toEqual(users['456def']);
return done();
});
it('adds the jwt to the headers', async done => {
it('adds the jwt to the headers', async () => {
const validJWT = jwt.sign({ accessToken }, validJWTSecret);
const req = mockReq({
path: '/some-path/that-needs/auth',
@ -267,7 +264,6 @@ describe('request-authorization', () => {
const next = jest.fn();
await requestAuthorization(req, res, next);
expect(res.set).toHaveBeenCalledWith('X-fcc-access-token', validJWT);
return done();
});
it('calls next if request does not require authorization', async () => {

View File

@ -593,7 +593,7 @@ describe('user stats', () => {
it('resolves a user for a given id', done => {
expect.assertions(7);
return getUserById(mockUserID, mockApp.models.User)
getUserById(mockUserID, mockApp.models.User)
.then(user => {
expect(user).toEqual(mockUser);