Skip to content

Karma helper function to make reading JSON files easier

License

Notifications You must be signed in to change notification settings

rom3r4/Karma-Read-JSON

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Karma-Read-JSON

Karma helper function to make reading JSON files easier

Install

bower install karma-read-json

Usage

  1. Put karma-read-json.js in your Karma files, Example:

     files = [
     ...
     'bower_components/karma-read-json/karma-read-json.js',
     ...
     ]
    
  2. Make sure your JSON is being served by Karma, Example:

     files = [
     ...
     {pattern: 'json/**/*.json', included: false},
     ...
     ]
    
  3. Use the readJSON function in your tests. Example:

     var valid_respond = readJSON('json/foobar.json');
     $httpBackend.whenGET(/.*/).respond(valid_respond);
    

About

Karma helper function to make reading JSON files easier

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%