Show HN: Node.js Testing Web Server

1 pointsposted 15 hours ago
by emnawer

1 Comments

emnawer

14 hours ago

Serverette will simplify your development process with a unified approach to unit testing. It will help consolidate your request and response tests into a single test file.

Request Example:

fetch('', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ test: 'testing POST method' }) }) .catch(error => { console.error('POST Error:', error); });

Response Example:

callbacks.post = function(array,response){

    test(array);
    response.writeHead(200, { 'Content-Type': 'text/html' });
    response.end("POST data received for JEST testing!");
}

Console output:

POST: [ '{"test":"testing POST method"}' ]