-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest-path-generation.js
More file actions
57 lines (51 loc) · 1.5 KB
/
test-path-generation.js
File metadata and controls
57 lines (51 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import { generatePathFromTitle } from './dist/utils/pathGeneration/index.js';
const testCases = [
// Known technologies
{
title: "How to find an element in Redis",
tags: ["redis", "database", "search"]
},
{
title: "JWT authentication best practices",
tags: ["jwt", "auth", "security"]
},
{
title: "Fix MongoDB connection timeout",
tags: ["mongodb", "error", "timeout"]
},
// Unknown technologies with context
{
title: "How to configure Terraspace for AWS deployments",
tags: ["terraspace", "aws", "iac", "deployment"]
},
{
title: "Pulumi vs Terraform comparison",
tags: ["pulumi", "terraform", "iac", "comparison"]
},
{
title: "Setting up Spacelift CI/CD pipeline",
tags: ["spacelift", "ci-cd", "automation"]
},
// Edge cases
{
title: "Understanding Quantum Computing basics",
tags: ["quantum", "computing", "theory"]
},
{
title: "React hooks tutorial with TypeScript",
tags: ["react", "hooks", "typescript", "tutorial"]
},
{
title: "Best practices for microservices architecture",
tags: ["microservices", "architecture", "best-practices"]
}
];
console.log("Path Generation Test Results\n");
console.log("=".repeat(80));
for (const testCase of testCases) {
const path = generatePathFromTitle(testCase.title, { tags: testCase.tags });
console.log(`\nTitle: "${testCase.title}"`);
console.log(`Tags: [${testCase.tags.join(", ")}]`);
console.log(`Generated Path: ${path}`);
}
console.log("\n" + "=".repeat(80));