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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:56:10+00:00 2026-06-15T04:56:10+00:00

Suppose I have the following code without asyncTest setTimeout(function(){ test (test1, function(){ ok(true, test1

  • 0

Suppose I have the following code without asyncTest

setTimeout(function(){
  test ("test1", function(){
    ok(true, "test1 works");
  }); 
}, 2000);

And, this code with asynTest

asyncTest ("test1", function(){
  setTimeout(function(){
    ok(true, "test1 works");
    start();
  }, 2000);
}); 

My question is what are the difference between these 2? Thanks.

  • 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-15T04:56:11+00:00Added an answer on June 15, 2026 at 4:56 am

    Taken from the qUnit documentation:

    Asynchronous tests added are queued and run one after the other.
    Equivalent to calling a normal test() and immediately calling stop().

    While setTimeout :

    Calls a function or executes a code snippet after specified delay.

    The difference is that seTimeout has nothing to do with qUnit and simple executes the specified code snippet after the specified amount of time, while qUnit’s asyncTest does not execute after a specified amount of time but instead is placed on a queue from which it eventually gets picked up and executed.

    Also I don’t think you are really comparing like-with-like.

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

Sidebar

Related Questions

Suppose I have the following html: This a test of <code>some code</code>. <div class='highlight'>
Suppose I have the following code function myFunction(param, callback) { ... if (err) {
Suppose we have the following code: <div id=test style=width:200px; height: 200px; overflow: hidden;> <p>Lorem
Suppose I have the following definitions: namespace test { class Test1 { void someMethod(double
Suppose I have following code package memoryleak; public class MemoryLeak { public static int
Possible Duplicate: Are file descriptors shared when fork()ing? Suppose I have following code in
Suppose I have the following code to collect all the possible combinations. abArray =
Suppose I have the following code: foreach(string str in someObj.GetMyStrings()) { // do some
suppose that,we have following code auto_ptr<T> source() { return auto_ptr<T>( new T(1) ); }
Suppose I have the following js code: r='d|daa|dd'; reg = /\|.*/; result = reg.exec(r);

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.