Spaces:
Running
Running
| const test = require('node:test'); | |
| const assert = require('node:assert/strict'); | |
| test('uploadDocument is wrapped with asyncController (returns async middleware function)', () => { | |
| const { uploadDocument } = require('../controllers/documentController'); | |
| assert.equal(typeof uploadDocument, 'function', 'uploadDocument must be a function'); | |
| // asyncController wraps the handler — the result accepts (req, res, next) | |
| assert.equal(uploadDocument.length, 3, 'wrapped handler must accept (req, res, next)'); | |
| }); | |