karma-properties2json-preprocessor
v0.1.0
Published
Preprocessor for converting .properties files into JSON files
Downloads
1
Maintainers
Readme
Karma properties2JSON preprocessor
Preprocessor for converting .properties files into JSON files.
Usage
npm install --save-dev karma-properties2json-preprocessor
In your Karma config file add the preprocessor:
preprocessors: {
'test.properties': 'properties2json'
}
The following configuration is supported:
properties2JsonPreprocessor: {
dist: 'test/mock/json/',
tree: true
}
Set the dist
option to the directory where Karma should serve the output. Default is 'spec/javascripts/fixtures/json/'
which is the same default path as jasmine-jquery uses for reading JSON fixtures.
If tree
is true, the keys in the properties are outputted as a JSON tree, delimited by colons instead of key/value pairs.
// test.properties
parent.childA=value1
parent.childB=value2
// test.json
{
"parent": {
"childA": "value1",
"childB": "value2"
}
}