Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function emitRun(testName) {
return Promise.resolve(`self.${exporter.parsers.sanitizeName(testName)}()`)
}
.map(s => {
if (s.startsWith('vars[')) {
return s
} else if (s.startsWith('Key[')) {
const key = s.match(/\['(.*)'\]/)[1]
return `Keys.${exporter.parsers.capitalize(key.toLowerCase())}`
} else {
return `"${s}"`
}
})
.join(' + ')
function generateFilename(name) {
return `${exporter.parsers.uncapitalize(
exporter.parsers.sanitizeName(name)
)}${opts.fileExtension}`
}
function generateFilename(name) {
return `${exporter.parsers.capitalize(
exporter.parsers.sanitizeName(name)
)}Test${opts.fileExtension}`
}
function emitControlFlowForEach(collectionVarName, iteratorVarName) {
const collectionName = exporter.parsers.capitalize(collectionVarName)
const iteratorName = exporter.parsers.capitalize(iteratorVarName)
return Promise.resolve({
commands: [
{
level: 0,
statement: `ArrayList collection${collectionName} = (ArrayList) vars.get("${collectionVarName}");`,
},
{
level: 0,
statement: `for (int i${iteratorName} = 0; i < collection${collectionName}.size() - 1; i${iteratorName}++) {`,
},
{
level: 1,
statement: `vars.put("${iteratorVarName}", collection${collectionName}.get(i));`,
},
],
})
function generateTestDeclaration(name) {
return `[Fact]\npublic void ${exporter.parsers.capitalize(
exporter.parsers.sanitizeName(name)
)}() {`
}
function generateMethodDeclaration(name) {
return `public void ${exporter.parsers.sanitizeName(name)}() {`
}
function generateSuiteDeclaration(name) {
async function emitRun(testName) {
return Promise.resolve(`${exporter.parsers.sanitizeName(testName)}()`)
}
function generateMethodDeclaration(name) {
return `def ${exporter.parsers.uncapitalize(
exporter.parsers.sanitizeName(name)
)}`
}
function generateSuiteDeclaration(name) {
function generateFilename(name) {
return `${exporter.parsers.capitalize(
exporter.parsers.sanitizeName(name)
)}Test${opts.fileExtension}`
}