-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Description
I have written an API to sign-in which works perfectly fine on Postman. Have written a test for the same but the test fails. Attaching the error and test written. Please provide a solution for same.
'use strict';
// tests for view_sneaker_room
// Generated by serverless-jest-plugin
const mod = require('./../src/routes/sign_in');
const jestPlugin = require('serverless-jest-plugin');
const lambdaWrapper = jestPlugin.lambdaWrapper;
const wrapped = lambdaWrapper.wrap(mod, { handler: 'handler' });
const testUserEmail = '[email protected]';
const testPassword= 'Admin@123';
jest.setTimeout(30000);
describe('signIn', () => {
beforeAll((done) => {
// lambdaWrapper.init(liveFunction); // Run the deployed lambda
done();
});
// it('verify response', () => {
// return wrapped.run({ queryStringParameters: { email: testUserEmail, password: testPassword} }).then((response) => {
// expect(response).toBeDefined();
// });
// });
it('200 works', () => {
return wrapped.run({ queryStringParameters: { email: testUserEmail,password: testPassword} }).then((response) => {
console.log("response :",response)
expect(response.statusCode).toBe(200);
expect(typeof response.body).toBe('string');
expect(response.headers['Content-Type']).toBe('application/json');
});
});
});
Metadata
Metadata
Assignees
Labels
No labels