@diffblue/java-combiner
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -98,5 +98,5 @@ "use strict"; | ||
} | ||
return Object.freeze({ imports, staticImports, testMethods }); | ||
return Object.freeze({ imports: imports, staticImports: staticImports, testMethods: testMethods }); | ||
} | ||
exports.combineTests = combineTests; | ||
//# sourceMappingURL=combineTests.js.map |
@@ -40,3 +40,4 @@ "use strict"; | ||
staticImports.sort(); | ||
return [staticImports, internalImports, javaStaticImports, javaImports].reduce((prev, current) => `${prev}${current.length ? `${current.join('\n')}\n\n` : ''}`, ''); | ||
const importsA = [staticImports, internalImports, javaStaticImports, javaImports]; | ||
return '\n' + importsA.filter((element) => element.length).map((element) => element.join('\n') + '\n').join('\n'); | ||
} | ||
@@ -342,5 +343,5 @@ /** | ||
.replace(/\n+$/, ''); | ||
splitCode.splice(importInsertLocation, 0, `\n\n${additionalImportsString}`); | ||
splitCode.splice(importInsertLocation, 0, `\n${additionalImportsString}`); | ||
} | ||
} | ||
//# sourceMappingURL=mergeTests.js.map |
@@ -232,11 +232,11 @@ "use strict"; | ||
impl: Object.freeze({ | ||
getMultiLineCommentChunk, | ||
getSingleLineCommentChunk, | ||
getStringChunk, | ||
replaceExact, | ||
getMultiLineCommentChunk: getMultiLineCommentChunk, | ||
getSingleLineCommentChunk: getSingleLineCommentChunk, | ||
getStringChunk: getStringChunk, | ||
replaceExact: replaceExact, | ||
}), | ||
parse, | ||
replaceInCodeChunks, | ||
stringifyChunk, | ||
parse: parse, | ||
replaceInCodeChunks: replaceInCodeChunks, | ||
stringifyChunk: stringifyChunk, | ||
}); | ||
//# sourceMappingURL=parse.js.map |
@@ -64,7 +64,8 @@ "use strict"; | ||
const classNameModified = className.replace(/\$/g, '_'); | ||
const classAnnotations = new Set(tests.map((test) => test.classAnnotations || [])); | ||
// Merge all tests' classAnnotation arrays into a single Set | ||
const classAnnotations = new Set([].concat(...tests.map((test) => test.classAnnotations))); | ||
const combinedTests = combineTests_1.combineTests({ tests: tests, existingImports: [] }); | ||
const testImports = combinedTests.imports; | ||
let staticImports = combinedTests.staticImports; | ||
const content = combinedTests.testMethods.join('\n\n'); | ||
const content = combinedTests.testMethods.join('\n\n').replace(/(\n|^)(.)/g, '$1 $2'); | ||
let annotation = '\n'; | ||
@@ -92,8 +93,12 @@ if (classAnnotations && classAnnotations.size) { | ||
return `${packageStatement} | ||
${imports}${annotation} | ||
public class ${classNameModified} { | ||
${rule} | ||
public final ExpectedException thrown = ExpectedException.none(); | ||
${rule} | ||
public final Timeout globalTimeout = new Timeout(10000); | ||
/* testedClasses: ${testedClasses} */ | ||
@@ -100,0 +105,0 @@ ${content} |
{ | ||
"name": "@diffblue/java-combiner", | ||
"description": "Java test combining library", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"main": "build/index.js", | ||
@@ -13,2 +13,6 @@ "types": "build/index.d.ts", | ||
}, | ||
"repository": { | ||
"type" : "git", | ||
"url" : "https://github.com/diffblue/cover-test-combiner-js" | ||
}, | ||
"author": "DiffBlue Limited", | ||
@@ -15,0 +19,0 @@ "private": false, |
@@ -1,7 +0,22 @@ | ||
Combine Java tests | ||
================== | ||
Diffblue Java combiner | ||
====================== | ||
The Diffblue Java combiner takes an array of Java methods (usually jUnit tests) and combines them into a | ||
single java class. | ||
It can also add new test methods to an existing class. | ||
## Installation | ||
Using npm: | ||
```bash | ||
npm install @diffblue/java-combiner | ||
``` | ||
## Usage | ||
Example usage: | ||
```JS | ||
```js | ||
var combiner = require('@diffblue/java-combiner'); | ||
@@ -16,1 +31,3 @@ | ||
``` | ||
© 2019 Diffblue Limited. See the file LICENSE for usage information. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
87384
36
1413
33
6
1