tlpp-dev-cli
Version:
CLI para agilizar o processo de criação de projetos em TLPP e ADVPR
14 lines (13 loc) • 507 B
JavaScript
import fs from 'node:fs/promises';
import path from 'node:path';
import { getCasesTemplate } from '../templates/tests/cases.js';
export async function generateCases(currentPath, nome) {
const templateSuite = getCasesTemplate(nome);
try {
await fs.mkdir(path.join(currentPath, 'Testes', 'Cases'), { recursive: true });
await fs.writeFile(path.join(currentPath, 'Testes', 'Cases', `${nome}TestCase.prw`), templateSuite);
}
catch (error) {
console.error(error);
}
}