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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:29:36+00:00 2026-05-23T22:29:36+00:00

I have the following Jasmine context and assertion: it should return a javascript file,

  • 0

I have the following Jasmine context and assertion:

it "should return a javascript file", ->
  # We make a request to /x.js
  request {uri: 'http://localhost:3000/x.js'}, (err, res, body) ->
    expect(res.statusCode).toEqual 200

When I call Jasmine to evaluate the spec, it does not pickup the assertion. How can I make it pickup the assertion?

  • 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-23T22:29:37+00:00Added an answer on May 23, 2026 at 10:29 pm

    Your it() is exiting before your request returns a response. With jasmine, you have to think about asynchronous events a bit harder.

    Check out waitsFor() and do something like this, which will prevent your spec from exiting until the callback is executed, or the default timeout period has elapsed.

    it "should return a javascript file", ->
      responded = no
      request {uri: 'http://localhost:3000/x.js'}, (err, res, body) ->
        responded = yes
        expect(res.statusCode).toEqual 200
    
      waitsFor -> responded
    

    This will also cause your spec to fail if the server times out, because each waitsFor() expects to be satisfied eventually.

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

Sidebar

Related Questions

I have following mysqli configuration settings on a separate file: $mysqli = new mysqli(localhost,
I have following url: http://localhost.com/phpdemo/bid/tf/red ? This url redirects through This [ $route['tf/red?'] =
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public
I have following text in a file 23456789 When I tried to replace the
I have following page <html> <head> <script type=text/javascript src=e01.js></script> </head> <body> <script type=text/javascript> var
i have following in a string. javascript: __doPostBack('GridWidget', 'Edit$0') how can i dynamically execute
Have following Java code,that creates StringBuilder with \n,i.e. carriage return delimiters: while (scanner.hasNextLine()){ sb.append(scanner.nextLine()).append(\n);
I have following code in a python script try: # send the query request
I have following xml file: <doc_xml> <nodes> <node id='1' spec={spec_a=0.9, spec_b=0.1} /> <node id='2'
I have following problem: My program should decide at runtime to load an function

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.