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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:49:52+00:00 2026-06-06T22:49:52+00:00

I am trying to do headless testing of my knockout viewmodels. I purposely avoid

  • 0

I am trying to do headless testing of my knockout viewmodels. I purposely avoid dealing with any ui constructs in my viewmodel and leave the wireup to the html page.

This works great in Jasmine since it runs in the browser, but when I switch to mocha, I end up running head-first into the last line on knockout which is:

})(window,document,navigator);

I’ve looked at using zombiejs which would be a nice alternative, but I don’t see a good story on how to use it without changing the knockout source itself.

Any thoughts on how to approach this?

  • 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-06T22:49:55+00:00Added an answer on June 6, 2026 at 10:49 pm

    This is a topic currently on my radar as well. I’ll dump my findings here in the hopes that they might point you in the right direction.

    The likely route I will attempt first will be PhantomJS. It’s a headless WebKit browser, so it should have excellent DOM, JSON, HTML5, and CSS selectors support (it works with jQuery and qUnit, for example).

    I chose this because it is used by knockout.js itself, which I discovered in the knockout.js repository, where there was a .travis.yml file and this comment:

    enter image description here

    I don’t have any proof that this is going to work, but was encouraged by its use in knockout.js core. I also found this runner script for knockout/phantom that looks like a great launch point.

    I’ve also found a few examples using Mocha and PhantomJS via node.js, including this lib extending grunt to run mocha inside Phantom, and this script showing how to run mocha inside PhantomJS. So that part is certain, at the very least.

    Another solution noted in the knockoutjs archives, is to use knockout-node and JsDOM to create a workable DOM, but at first glance, this seemed too nebulous and likely to result in implementing your own test environment.

    There is a slidedeck suggesting zombie.js would work with knockout/node/etc. But I can’t find anything offering hard evidence, so I didn’t like this route either.

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

Sidebar

Related Questions

Trying to parse an HTML document and extract some elements (any links to text
I'm trying to run headless tests from Jenkins. This works fine for HTML tests
I am trying to use a headless browser in .Net and I need it
Trying to avoid the SomethingManager trap here... Let's say I'm going to write a
I'm trying to get Jasmine (jasmine-headless-webkit), coffeescript and backbone to work together. I'm close
I followed some online guides trying to get some headless VMs to start/suspend automatically
Trying to find some information on this but am unable to get any results
I'm trying to run Equinox and antRunner in headless mode with a custom eclipse.ini
I'm trying to get my Android tests running on headless emulator for future use
I'm trying to follow the tutorial here to setup a headless selenium test-run with

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.