All posts tagged unit testing

  • Using Sinon’s FakeServer in QUnit test Setup and Teardown

    I’ve recently begun switching from Buster.js to QUnit for my GitJs project and I discovered a roadblock when it came to using Sinon’s FakeServer in QUnit’s setup and teardown methods in a module. According to a blog post on Christian Johansen’s website, to use the fakeServer object you do something like this:

    Read more

  • Recommended Reading: Test-Driven JavaScript Development

    Test-driven development can be a tricky thing to master and, depending on what language you prefer to code in, resources on the topic can be lacking. For JavaScript developers, however, there’s help. Christian Johansen’s book Test-Driven JavaScript Development is a solid guide to getting started with TDD in JavaScript.

    Read more

  • How to Run Buster.js Unit Tests in (and Against) the Browser

    Previously, I gave a brief introduction to Buster.js and how it’s used. Today, I’m going to show you how to set up Buster.js to run tests against a browser as well as how to use setUp and tearDown to reduce redundancy in your unit tests.

    Read more

  • Getting Started With Buster.js

    Buster.js is a unit testing framework for JavaScript applications. With it, you can write web applications using the Test Driven Development method which in turn leads to code that is easier to change and maintain.

    Read more

  • How to Pass in Parameters to BusterJs assert.exception and refute.exception

    Recently I was working with BusterJs’s assert.exception and refute.exception methods and ran into an issue with their documentation. In their example docs for those methods, they show how you can pass in an object literal that either does or does not throw an exception (depending on which method you’re using). This helpful in getting started, but I thought I’d chime in and give an example on how to use these methods if you’re writing unit tests for an API or library.