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 8788649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:11:35+00:00 2026-06-13T22:11:35+00:00

Short and seemingly stupid question because so simple and you’d think ubiquitous: has anyone

  • 0

Short and seemingly stupid question because so simple and you’d think ubiquitous: has anyone gotten any kind of code coverage to work within a RequireJS front-end project (non NodeJS)?

Seems like a stupid question because of the prevalence of TDD approaches in the JS world and the take-over of AMD development.

I’ve tried a million approaches, all are lacking. My project is a Backbone project with Jasmine Unit Tests:

1) JSTD with Coverage plugin. JSTD has trouble properly loading and instrumenting AMD modules. If I run JSTD on a single js file (combined by RequireJS optimizer) then code coverage works beautifully, EXCEPT that coverage is then collected and metrics defined on the ENTIRE file. Great, that’s useless because that includes 3rd party libraries, and because I can’t target a single unit to help test development. Argh.

2) JSCoverage – total fail, doesn’t like AMD modules.

3) Chrome specific & Firebug specific ‘live’ instrumenters – fail, don’t like AMD modules.

Every approach I try seems to require massive amounts of custom work.
So maybe I need to spin a custom solution from scratch?

How about the following approach: expand the RequireJS optimizer to instrument code and create coverage. It would be in-memory instrumentation which can be enabled with a require.config({ instrument: true }) flag. Every time require loads a module it automatically instruments it and places it in its module repository. Coverage statistics are collected in an object underneath the global require object and accessible from anywhere, say, after a Jasmine test-run.

Input?

  • 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-13T22:11:36+00:00Added an answer on June 13, 2026 at 10:11 pm

    Blanket.js works with Qunit using a modified RequireJS loader. We’re working on Jasmine support, and will be happy to accept any feedback or suggestions.

    If your project is going into production, Blanket.js isn’t for you, but if it’s just a side project it might be worth seeing if it meets your needs.

    EDIT: Blanket now supports Jasmine.

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

Sidebar

Related Questions

Short and simple, our project has a Launcher component and an Application component and
Short and simple question. In Winforms you can bind a dataview to a combobox
I know this question has been asked and seemingly answered a gazillion times over
I'm getting some weird output when running (seemingly simple) code. Here's what I have:
I have a (seemingly) simple question to read in a string and print it
A seemingly simple question: Can I have some sort of Number object, which can
Short question, is the following ok: struct X { A& x; A y; X()
Short question: Is it possible to detect window.open() in a UIWebView using the UIWebViewDelegate
Short Question: Can I specify wildcards for custom console folding? If so, what is
I have a seemingly simple requirement, but i can't figure out how to write

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.