Skip to content

bestander/jasmine

 
 

Repository files navigation

A JavaScript Testing Framework

Jasmine is a Behavior Driven Development testing framework for JavaScript. It does not rely on browsers, DOM, or any JavaScript framework. Thus it's suited for websites, Node.js projects, or anywhere that JavaScript can run.

Documentation & guides live here: http://pivotal.github.com/jasmine/

Component notes

The best way to use this component is to define it as a dev dependency in your component.json file.

  "development": {
    "bestander/jasmine": "*"
  }

Then in the spec-runner HTML do

    <!-- no links to jasmine standalone component -->

    <!-- path to a `component(1)` built package -->
    <script type="text/javascript" src="../build/build-dev.js"></script>
    <script type="text/javascript" src="../build/build-dev.css"></script>

    <!-- list of your test spec files -->
    <script type="text/javascript" src="logic.spec.js"></script>
    <script type="text/javascript" src="moreLogic.spec.js"></script>
    <script type="text/javascript">
        (function () {
          var currentWindowOnload;
          var htmlReporter;
          var jasmine = require("<host name>/deps/jasmine").jasmine;
          var jasmineEnv = jasmine.getEnv();
          jasmineEnv.updateInterval = 1000;

          htmlReporter = new jasmine.HtmlReporter();

          jasmineEnv.addReporter(htmlReporter);

          jasmineEnv.specFilter = function (spec) {
            return htmlReporter.specFilter(spec);
          };

          currentWindowOnload = window.onload;

          window.onload = function () {
            if (currentWindowOnload) {
              currentWindowOnload();
            }
            execJasmine();
          };

          function execJasmine() {
            jasmineEnv.execute();
          }

        })();
    </script>

Support

Maintainers

Copyright (c) 2008-2012 Pivotal Labs. This software is licensed under the MIT License.

About

DOM-less simple JavaScript testing framework

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 94.2%
  • Ruby 5.8%