snapsnap
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -43,2 +43,3 @@ "use strict"; | ||
var path_1 = __importDefault(require("path")); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
var analyzer_1 = require("../../analyzer"); | ||
@@ -95,3 +96,3 @@ var reporter_1 = require("./reporter"); | ||
na = new analyzer_1.NockAnalyzer({ | ||
identifier: this.reporter.currentSpec.fullName, | ||
identifier: this.getCleanTestFileName() + "-" + this.reporter.currentSpec.fullName, | ||
snapshotPath: path_1.default.join(path_1.default.dirname(this.reporter.currentSpec.testPath), '__http__'), | ||
@@ -107,2 +108,13 @@ }); | ||
}; | ||
JestIntegration.prototype.getCleanTestFileName = function () { | ||
var fn = path_1.default.basename(this.reporter.currentSpec.testPath); | ||
return lodash_1.default.reduce([ | ||
/.js$/, | ||
/.ts$/, | ||
/.jsx$/, | ||
/.tsx$/, | ||
/.test$/, | ||
/.spec$/, | ||
], function (aggregator, regex) { return aggregator.replace(regex, ''); }, fn); | ||
}; | ||
return JestIntegration; | ||
@@ -109,0 +121,0 @@ }()); |
{ | ||
"name": "snapsnap", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Tools for snapshotting, replaying, and mocking HTTP queries with Jest", | ||
@@ -26,3 +26,3 @@ "main": "dist/index.js", | ||
"test": "jest", | ||
"prepublishOnly": "rm -rf ./dist && npm run build", | ||
"prepublishOnly": "npm test && npm run lint && rm -rf ./dist && npm run build", | ||
"lint:md": "remark .", | ||
@@ -29,0 +29,0 @@ "lint:eslint": "eslint 'src/**/*.ts' '__tests__/**/*.ts'", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
46886
682