Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6530087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:42:49+00:00 2026-05-25T09:42:49+00:00

Given an existing Node.js application that implements a RESTful API with JSON format, what

  • 0

Given an existing Node.js application that implements a RESTful API with JSON format, what would be good options for writing an integration testing suite in Node.js?

This suite should execute test scenarios that would typically consist of setting a database to a known state (possibly through POST requests) and running a series of tests involving GET, POST, PUT and DELETE requests, checking for returned status codes and responses.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T09:42:50+00:00Added an answer on May 25, 2026 at 9:42 am

    There are a few options for unit testing frameworks.

    • vows
    • expresso
    • nodeunit

    I’ll show examples with expresso & vows.

    var assert = require('assert'),
        http = require('http'),
        server = getServer(); // get an instance of the HTTPServer
    
    assert.response(server, {
        'url': '/'
    }, {
        'body': "test body",
        'status': "200"
    });
    

    And an example with vows-is

    var is = require("vows-is");
    
    is.config({
        server: {
            "factory": createServer,
            "kill": destroyServer,
            "uri": "http://localhost:4000"
        }
    })
    
    is.suite("integration tests").batch()
    
        .context("a request to GET /")
        .topic.is.a.request("GET /")
        .vow.it.should.have.status(200)
        .vow.it.should.have
            .header("content-type", "text/html; charset=utf-8")
        .context("contains a body that")
            .topic.is.property('body')
            .vow.it.should.be.ok
            .vow.it.should.include.string("hello world")
    
    .suite().run({
        reporter: is.reporter
    }, function() {
        is.end()
    });
    

    vows-is is a thin abstraction on top of vows to make it easier to test with.

    However vows-is is under active development so use at your own risk.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given a valid, arbitrary xmlNodePtr, I would like the string representation of that node,
I've been given an existing PHP application that was originally deployed on a LAMP
I'm wondering whether there is an existing Java class that, given a Java bean,
Noticed this today. Given that a file named existing exists in the PWD of
I'm trying to use XPath/XSLT to add a node to an existing node that
Given an existing JSP project, I would like to get a feel for the
Given an existing valid SVG document, what's the best way to create informational popups,
I have been given the task of adding functionality to an existing IIS 6.0
Given an absolute or relative path (in a Unix-like system), I would like to
I am working on a wrapper that parses a data file for an existing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.