Skip to content

Remove basic to only use sample modules with addition test suites - #473

Open
datruong-ibmmq wants to merge 1 commit into
ibm-messaging:masterfrom
datruong-ibmmq:datruong_node.js_remove_basic_modules-
Open

Remove basic to only use sample modules with addition test suites#473
datruong-ibmmq wants to merge 1 commit into
ibm-messaging:masterfrom
datruong-ibmmq:datruong_node.js_remove_basic_modules-

Conversation

@datruong-ibmmq

Copy link
Copy Markdown

Description

refactor(Node.js): replace basic* modules with sample* test suite and fix sampleresponse null-byte parsing

Removed files

  • basicput.js, basicget.js, basicpublish.js, basicsubscribe.js,
    basicrequest.js, basicresponse.js
  • test/basicput.test.js, test/basicget.test.js

Added files

  • test/sampleput.test.js (5 suites, 5 tests)
  • test/sampleget.test.js (4 suites, 4 tests)
  • test/samplepublish.test.js (2 suites, 2 tests)
  • test/samplesubscribe.test.js(2 suites, 2 tests)
  • test/samplerequest.test.js (1 suite, 1 test)
  • test/sampleresponse.test.js (3 suites, 7 tests)

Total: 21 test cases across 17 suites covering all six sample patterns.
All tests connect to a live IBM MQ broker via env.json.

Bug fix

  • sampleresponse.js: JSON.parse now strips null-byte buffer padding
    before parsing (buf.toString().replace(/\0/g,'').trim()), matching
    the behaviour of the removed basicresponse.js.

  • sampleresponse.js: added module.exports = { performCalc, MSG_TRESHOLD }
    to allow test-time import of pure exports.

README.md (Node.js)

  • Removed all references to the deleted basic* files.
  • Added per-file test breakdown table (suites, test count, description).
  • Removed duplicate npm install instruction from the Tests section.

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.

1 participant