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

  • Home
  • SEARCH
  • 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 8302357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:16:10+00:00 2026-06-08T17:16:10+00:00

I’m trying to use Nodeunit to test my Backbone models and later I’d like

  • 0

I’m trying to use Nodeunit to test my Backbone models and later I’d like to test the other components as well. The main reason I’m using Nodeunit is because my server tests are using it already and I’d like to stick with one testing framework.

Is this a good idea? I’ve made one feable attempt of setting up a unit test, but it fails when I try to require the underscore and backbone libraries:

Error: Cannot find module 'underscore'

Is it possible at all to use nodeunit for this and if not what would the recommend unit-testing framework be for testing a Backbone app?

  • 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-06-08T17:16:11+00:00Added an answer on June 8, 2026 at 5:16 pm

    You are probably not including your RequireJS config in your NodeUnit test runner html. Or, if you are, perhaps NodeUnit isn’t serving dynamic content in the same way. I’ve not used it before, but I ran into a similar problem with Jasmine.

    With the jasmine approach, I had to do something like this:

    # coffeescript #
    TEST_ENV = (typeof window['jasmine'] == 'object')
    prefix = if TEST_ENV then '/public' else ''
    baseUrl = prefix + '/javascripts'
    

    In the jasmine-gem world (within rails), the /public folder is served out of the actual /public route. (Normal rails serving assumes the /public folder is actually the root route.) So, this bit of code checks for a test context and adds the /public prefix to the baseUrl. Then, in my requireJS config, I assign this baseUrl.

    This may be the same issue you are having with NodeUnit.

    For more information on how I set this up, as well as special RequireJS + Jasmine integration, see my blog post.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I would like to count the length of a string with PHP. The string

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.