Skip to content

Helper function for Karma that makes reading JSON files easier

License

Notifications You must be signed in to change notification settings

osidenate/Karma-JSON-Reader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Karma-JSON-Reader

Helper function for Karma that makes reading JSON files easier

Install

bower install karma-json-reader

Usage

  1. Include karma-json-reader.js in your karma.conf.js.

     files = [
         ...
         'bower_components/karma-read-json/karma-json-reader.js',
         ...
     ]
    
  2. Include your JSON data in your karma.conf.js.

     files = [
         ...
         { pattern: 'test/data/*.json', watched: true, served: true, included: false },
         ...
     ]
    
  3. Use KarmaJSONReader to get your JSON data.

     var jsonReader = new KarmaJSONReader('path/to/json/files/');
     var mockData = jsonReader.readJSON('mockData.json');
    

About

Helper function for Karma that makes reading JSON files easier

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%