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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:36:06+00:00 2026-05-18T01:36:06+00:00

The introduction to QUnit over at netTuts.com spawns an interesting exchange (never resolved) over

  • 0

The introduction to QUnit over at netTuts.com spawns an interesting exchange (never resolved) over how to apply unit tests against actions that manipulate the DOM. The following quote (Alex York) gets to the crux:

What would be nice is that if you had
a function like this:

function add(a, b) { var result = a +
b;
$(“input#ResultTestBox”).val(result);

In the above test, I would love to
test two things: the addition of a and
b, and the result correctly being put
into a DOM element. I would love to
test the second thing by providing
some mock HTML. Possible?

But, like I said…unresolved. Resolvable?

  • 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-18T01:36:06+00:00Added an answer on May 18, 2026 at 1:36 am

    The latest version of QUnit supports a #qunit-fixture element that lets you add HTML to the QUnit web page.

    E.g., in your HTML:

    <ol id="qunit-tests"></ol>
    <div id="qunit-fixture">test markup, will be hidden</div>
    

    and in your JavaScript:

    $('<input id="ResultTestBox" type="text"/>').appendTo('#qunit-fixture');
    var result = add(a, b);
    
    equals(result, $('input#ResultTestBox').val(), "testing result box value");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has the introduction of the .net framework made raw programming in COM and DCOM
Can anyone point me to a good introduction to coding against the paypal API?
Introduction I've always been searching for a way to make Visual Studio draw a
Introduction In my current organisation, we have many desktop and web applications all feeding
I'm working on getting an Introduction to Groovy presentation ready for my local Java
I'm reading through A Gentle Introduction to Haskell, and early on it uses this
I am looking for some material giving introduction to DAO and ADO usage in
I'm looking for a laymen's introduction to computer hardware and organization. Here are some
I have a section: \section{Introduction} \label{sec:introduction} I'd like a link to the section where
I'm looking for a good 10 minute introduction to Unobtrusive Javascript using JQuery. I'm

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.