https://github.com/pizzapanther/karma-read-json
Karma helper function to make reading JSON files easier
https://github.com/pizzapanther/karma-read-json
Last synced: about 1 month ago
JSON representation
Karma helper function to make reading JSON files easier
- Host: GitHub
- URL: https://github.com/pizzapanther/karma-read-json
- Owner: pizzapanther
- License: mit
- Created: 2015-01-07T22:10:23.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-23T16:17:41.000Z (about 10 years ago)
- Last Synced: 2024-03-14T20:51:44.139Z (about 1 year ago)
- Language: JavaScript
- Size: 176 KB
- Stars: 18
- Watchers: 3
- Forks: 9
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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);