first commit
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
import { getRegionInfo, REGIONS_DATA } from '../src/data/regions.js';
|
||||
import { TARGETS, SUBJECTS, findTarget, findSubject } from '../src/data/subjects.js';
|
||||
|
||||
console.log('=== [1. 과목 및 대상 검증] ===');
|
||||
const t1 = findTarget('middle');
|
||||
const t2 = findTarget('high');
|
||||
const t3 = findTarget('중학생');
|
||||
const t4 = findTarget('고등학생');
|
||||
console.log('findTarget(middle):', t1.name, t1.slug);
|
||||
console.log('findTarget(high):', t2.name, t2.slug);
|
||||
console.log('findTarget(중학생):', t3.name, t3.slug);
|
||||
console.log('findTarget(고등학생):', t4.name, t4.slug);
|
||||
|
||||
const s1 = findSubject('math');
|
||||
const s2 = findSubject('science');
|
||||
const s3 = findSubject('국어');
|
||||
const s4 = findSubject('영어');
|
||||
console.log('findSubject(math):', s1.name, s1.slug);
|
||||
console.log('findSubject(science):', s2.name, s2.slug);
|
||||
console.log('findSubject(국어):', s3.name, s3.slug);
|
||||
console.log('findSubject(영어):', s4.name, s4.slug);
|
||||
|
||||
console.log('\n=== [2. 영문 URL Slug 지역 파싱 검증] ===');
|
||||
const testCases = [
|
||||
{ sido: 'daegu', sigungu: 'suseong-gu', dong: 'hwanggeum-dong' },
|
||||
{ sido: 'seoul', sigungu: 'gangnam-gu', dong: 'daechi-dong' },
|
||||
{ sido: 'gyeonggi', sigungu: 'bundang-gu', dong: 'sunae-dong' },
|
||||
{ sido: 'busan', sigungu: 'haeundae-gu', dong: 'u-dong' },
|
||||
{ sido: 'incheon', sigungu: 'yeonsu-gu', dong: 'songdo-dong' },
|
||||
{ sido: 'daejeon', sigungu: 'yuseong-gu', dong: 'sinseong-dong' },
|
||||
{ sido: 'gwangju', sigungu: 'nam-gu', dong: 'bongseon-dong' },
|
||||
// 한글 입력 테스트
|
||||
{ sido: '대구', sigungu: '수성구', dong: '황금동' },
|
||||
{ sido: '서울', sigungu: '강남구', dong: '대치동' }
|
||||
];
|
||||
|
||||
testCases.forEach((tc, idx) => {
|
||||
const info = getRegionInfo(tc.sido, tc.sigungu, tc.dong);
|
||||
console.log(`[Test ${idx + 1}] Input: ${tc.sido}/${tc.sigungu}/${tc.dong}`);
|
||||
console.log(` -> Output: ${info.sido} ${info.sigungu} ${info.dong} (sidoSlug: ${info.sidoSlug}, sigunguSlug: ${info.sigunguSlug}, dongSlug: ${info.dongSlug})`);
|
||||
console.log(` -> Schools Middle: ${info.schools.middle[0]}, High: ${info.schools.high[0]}`);
|
||||
console.log(` -> Teachers: ${info.teachersCount}명, Nearby: ${info.nearbyDongs.slice(0, 3).join(', ')}`);
|
||||
});
|
||||
|
||||
console.log('\n=== [3. 등록된 총 지역 수 및 10개 조합 웹페이지 수] ===');
|
||||
let totalDongs = 0;
|
||||
REGIONS_DATA.forEach(s => {
|
||||
s.sigunguList.forEach(g => {
|
||||
totalDongs += g.dongList.length;
|
||||
});
|
||||
});
|
||||
console.log(`전국 등록 동 수: ${totalDongs}개 동`);
|
||||
console.log(`생성 가능한 전용 랜딩 페이지 수: ${totalDongs * 10}개 페이지 (중등 5과목 + 고등 5과목)`);
|
||||
console.log('\n[ALL TESTS PASSED]');
|
||||
Reference in New Issue
Block a user