Skip to content

This is how a typical javascript project with jasmine BDD framework would look like.

Notifications You must be signed in to change notification settings

karthiks/jasmine_standalone_lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jasmine Standalone

This is basically the Jasmine Standalone Release

It includes:

Writing a new spec

When creating a new module and its corresponding spec file, remember it all in the SpecRunner.html like below:

Example:

  <!-- include source files here... -->
  <script src="src/helloWorld.js"></script>

  <!-- include spec files here... -->
  <script src="spec/helloWorld_spec.js"></script>

The SpecRunner

The Javascript code that launches and executes the specs/tests resides in the specRunner.html, within the <script> tags as below:

<script type="text/javascript">
    (function() {
      var jasmineEnv = jasmine.getEnv();
      jasmineEnv.updateInterval = 1000;

      var trivialReporter = new jasmine.TrivialReporter();

      jasmineEnv.addReporter(trivialReporter);

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

      var currentWindowOnload = window.onload;

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

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

    })();
  </script>

Put together by

Karthik Sirasanagandla

My hearty thanks goes to the ones I'm inspired by.

Made with great inspiration from

About

This is how a typical javascript project with jasmine BDD framework would look like.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published