karma-json-fixtures-preprocessor
Advanced tools
Comparing version 0.0.1 to 0.0.3
@@ -19,2 +19,6 @@ module.exports = (function () { | ||
var transformPath = config.transformPath || function(filepath) { | ||
return filepath.replace(/\.json$/, '.js'); | ||
}; | ||
return function (content, file, done) { | ||
@@ -31,3 +35,4 @@ var fixtureName = file.originalPath | ||
file.path = file.path.replace(/\.json$/, '.js'); | ||
// transform file path | ||
file.path = transformPath(file.path); | ||
@@ -34,0 +39,0 @@ done(util.format(template, fixtureName, content)); |
{ | ||
"name": "karma-json-fixtures-preprocessor", | ||
"version": "0.0.1", | ||
"version": "0.0.3", | ||
"description": "A Karma plugin to compile JSON files and make them accessible from Javascript code", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "./node_modules/karma/bin/karma start ./test/test_karma.conf.js --single-run" | ||
}, | ||
@@ -26,3 +26,12 @@ "repository": { | ||
}, | ||
"homepage": "https://github.com/dmitriiabramov/karma-json-fixtures-preprocessor" | ||
"homepage": "https://github.com/dmitriiabramov/karma-json-fixtures-preprocessor", | ||
"devDependencies": { | ||
"chai": "^3.0.0", | ||
"karma": "^0.12.36", | ||
"karma-chai": "^0.1.0", | ||
"karma-mocha": "^0.1.10", | ||
"karma-phantomjs-launcher": "^0.2.0", | ||
"mocha": "^2.2.5", | ||
"phantomjs": "^1.9.17" | ||
} | ||
} |
karma-json-fixtures-preprocessor | ||
================================ | ||
[](https://travis-ci.org/dmitriiabramov/karma-json-fixtures-preprocessor) | ||
##### Preprocessor for converting .json files into .js files and making them accessible from karma test environment | ||
@@ -11,3 +13,3 @@ | ||
"karma": "~0.12.1", | ||
"karma-json-fixtures-preprocessor": "0.0.0" | ||
"karma-json-fixtures-preprocessor": "0.0.1" | ||
} | ||
@@ -35,3 +37,7 @@ } | ||
// change the global fixtures variable name | ||
variableName: '__mocks__' | ||
variableName: '__mocks__', | ||
// transform the filename | ||
transformPath: function(path) { | ||
return path + '.js'; | ||
} | ||
} | ||
@@ -38,0 +44,0 @@ }); |
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
7124
9
90
1
62
7