We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We have written NodeJS based express application. REST API is defined as following:
router.get('/module/:id/', async (req, res ) => { try { var moduleid = req.params.id const module = await ModuleMaster.findById(moduleid) if(!module || !module.modulefile){ throw new Error('Module does not exist') } res.set('Content-Type','application/zip') res.send(module.modulefile) } catch (error) { res.status(404).send(error.Message) } })
Above function is successfully returning file is being tested in browser and postman.
As part of automation, we have written following Jest script to test the functionality of receiving file.
const request = require('supertest') responseFromFileFAPI = await request(app).get('/module/1') .expect(200) expect(responseFromFileFAPI.body).not.toBeNull() expect(responseFromFileFAPI.body.Buffer)
All above expect are passing however I am not sure how can I convert the response to zip format so that I can use it to compare with original file?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
We have written NodeJS based express application. REST API is defined as following:
Above function is successfully returning file is being tested in browser and postman.
As part of automation, we have written following Jest script to test the functionality of receiving file.
All above expect are passing however I am not sure how can I convert the response to zip format so that I can use it to compare with original file?
The text was updated successfully, but these errors were encountered: