diff --git a/README.md b/README.md index c227a3c..88fac8e 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,30 @@ -# Karma-Read-JSON -Karma helper function to make reading JSON files easier +# Karma-JSON-Reader +Helper function for Karma that makes reading JSON files easier ## Install -`bower install karma-read-json` +`bower install karma-json-reader` ## Usage -1. Put karma-read-json.js in your Karma files, Example: +1. Include karma-json-reader.js in your karma.conf.js. files = [ - ... - 'bower_components/karma-read-json/karma-read-json.js', - ... + ... + 'bower_components/karma-read-json/karma-json-reader.js', + ... ] -2. Make sure your JSON is being served by Karma, Example: +2. Include your JSON data in your karma.conf.js. files = [ - ... - {pattern: 'json/**/*.json', included: false}, - ... + ... + { pattern: 'test/data/*.json', watched: true, served: true, included: false }, + ... ] -3. Use the `readJSON` function in your tests. Example: +3. Use `KarmaJSONReader` to get your JSON data. - var valid_respond = readJSON('json/foobar.json'); - $httpBackend.whenGET(/.*/).respond(valid_respond); + var jsonReader = new KarmaJSONReader('path/to/json/files/'); + var mockData = jsonReader.readJSON('mockData.json'); + diff --git a/bower.json b/bower.json index 3bcf5db..9e494d2 100644 --- a/bower.json +++ b/bower.json @@ -1,22 +1,23 @@ { - "name": "karma-read-json", - "version": "1.0.2", - "homepage": "https://github.com/pizzapanther/Karma-Read-JSON", - "authors": [ - "Paul Bailey " - ], - "description": "helper function for Karma to read JSON files easier", - "main": "karma-read-json.js", - "keywords": [ - "karma", - "json" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] + "name": "karma-read-json", + "version": "1.0.3", + "homepage": "https://github.com/osidenate/Karma-Read-JSON", + "authors": [ + "Paul Bailey ", + "Nathan Nelson " + ], + "description": "Helper function for Karma that makes reading JSON files easier", + "main": "karma-read-json.js", + "keywords": [ + "karma", + "json" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] } diff --git a/karma-read-json.js b/karma-json-reader.js similarity index 100% rename from karma-read-json.js rename to karma-json-reader.js