Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wrong file detection in nodejs #55

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@ First Release for Vs Code Extension.
## [1.0.11]

- Maintaining user session

## [1.0.12]

- Fixing wrong file test generation in express mongoose
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "keployio",
"displayName": "Keploy",
"description": "Streamline testing with the power of Keploy, directly in your favorite IDE.",
"version": "1.0.11",
"version": "1.0.12",
"publisher": "Keploy",
"icon": "media/logo.png",
"pricing": "Free",
Expand Down
3 changes: 1 addition & 2 deletions src/Utg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ async function Utg(context: vscode.ExtensionContext) {

const rootDir = vscode.workspace.workspaceFolders[0].uri.fsPath;

await ensureTestFileExists(sourceFilePath , rootDir);

const extension = path.extname(sourceFilePath);
let testFilePath: string;
Expand All @@ -61,7 +60,7 @@ async function Utg(context: vscode.ExtensionContext) {
let testFileContent:string;

if (extension === '.js' || extension === '.ts') {
testFilePath = sourceFilePath.replace(extension, `.test${extension}`);
testFilePath = path.join(path.join(rootDir, 'test'), path.basename(sourceFilePath).replace(extension, `.test${extension}`));
if (!fs.existsSync(testFilePath)) {
vscode.window.showInformationMessage("Test doesn't exist", testFilePath);
fs.writeFileSync(testFilePath, `// Test file for ${testFilePath}`);
Expand Down
Loading