Skip to content
New issue

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

Unit test case for basicget.js #234

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

tanaysingh3484
Copy link
Contributor

Created a Unit-test file for the basicget.js file, using the Chai assertion library.

@tanaysingh3484 tanaysingh3484 changed the title Unit test case for the basicget.js Unit test case for basicget.js Apr 19, 2024
@@ -0,0 +1,234 @@
const { buildMQDetails, ccdtCheck, initialise, connx, open, close, disconnect, getMessage } = require('../basicget');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README needs updating with instructions on how to run the tests.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package.json will need updating to allow for npm test command


it('Should perform MQGET', async () => {
for (let i = 0; i < envConfigLength; i++) {
await buildMQDetails(MQDetails, credentials, i);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a copy and paste of the put logic. Instead, just run basicput, then test that the get functions run.

@tanaysingh3484
Copy link
Contributor Author

tanaysingh3484 commented May 2, 2024

  • Updated the MQGET test by adding an exec statement to first execute the basicput.js file, following which the getMessage function is called
  • Updated a few functions which tested the resolution or rejection of promises, by using the chai-as-promised library, that deals with testing functions that return a Promise.
  • Added a README for the test directory, which contains the information needed to run these testcases
  • Updated the basicget.js with the required module.exports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants