-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest-cscp.ts
More file actions
25 lines (22 loc) · 776 Bytes
/
test-cscp.ts
File metadata and controls
25 lines (22 loc) · 776 Bytes
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
import { NameEnhanced } from './client/src/lib/NameEnhanced';
const testCases = [
'Chaitanya Saha CSCP, CPIM, CTSC',
'John Smith MBA, CPA',
'Jane Doe PhD, MD',
'Bob Jones CSCP',
];
console.log('Testing credential removal:\n');
testCases.forEach(testName => {
const name = new NameEnhanced(testName);
console.log(`Input: "${testName}"`);
console.log(` Valid: ${name.isValid}`);
console.log(` First: "${name.firstName}"`);
console.log(` Middle: "${name.middleName}"`);
console.log(` Last: "${name.lastName}"`);
console.log(` Suffix: "${name.suffix}"`);
console.log(` Repairs: ${name.parseLog.length}`);
name.parseLog.forEach(log => {
console.log(` - ${log.reason}: "${log.original}" -> "${log.repaired}"`);
});
console.log('');
});