test-gen-js 0.1.2 โ†’ 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +143 -143
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -8,50 +8,50 @@
8
8
 
9
9
  ---
10
10
 
11
- ## ๐ŸŽฏ ๋ชฉํ‘œ (Goal)
11
+ ## ๐ŸŽฏ Goal
12
12
 
13
- > **"ํ…Œ์ŠคํŠธ 0๊ฐœ โ†’ ๊ธฐ๋ณธ ํ…Œ์ŠคํŠธ๋ผ๋„ ์žˆ๋Š” ์ƒํƒœ"**
13
+ > **"From zero tests to having basic tests"**
14
14
 
15
- ์ด ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋Š” ์™„๋ฒฝํ•œ ํ…Œ์ŠคํŠธ ์ž๋™ํ™”๊ฐ€ ์•„๋‹Œ, **ํ…Œ์ŠคํŠธ ์ž‘์„ฑ์˜ ์ง„์ž… ์žฅ๋ฒฝ์„ ๋‚ฎ์ถ”๋Š” ๊ฒƒ**์„ ๋ชฉํ‘œ๋กœ ํ•ฉ๋‹ˆ๋‹ค.
15
+ This library is not about perfect test automation, but about **lowering the barrier to writing tests**.
16
16
 
17
- ### ์ด ๋„๊ตฌ๊ฐ€ ํ•ด๊ฒฐํ•˜๋Š” ๋ฌธ์ œ
17
+ ### Problems This Tool Solves
18
18
 
19
- | ๋ฌธ์ œ | ํ•ด๊ฒฐ |
20
- |------|------|
21
- | ๐Ÿ˜ซ "ํ…Œ์ŠคํŠธ ํŒŒ์ผ ๋งŒ๋“ค๊ธฐ ๊ท€์ฐฎ์•„์š”" | โœ… ๋ณด์ผ๋Ÿฌํ”Œ๋ ˆ์ดํŠธ ์ž๋™ ์ƒ์„ฑ |
22
- | ๐Ÿค” "์–ด๋–ป๊ฒŒ ์‹œ์ž‘ํ•ด์•ผ ํ• ์ง€ ๋ชจ๋ฅด๊ฒ ์–ด์š”" | โœ… ์‹คํ–‰ ๊ฐ€๋Šฅํ•œ ์‹œ์ž‘์  ์ œ๊ณต |
23
- | ๐Ÿ˜ฐ "๋ Œ๋”๋ง ๊ธฐ๋ณธ ํ…Œ์ŠคํŠธ๋„ ์—†์–ด์š”" | โœ… ์ตœ์†Œํ•œ์˜ ์•ˆ์ „๋ง ์ œ๊ณต |
24
- | ๐Ÿ“š "ํ…Œ์ŠคํŠธ ์ž‘์„ฑ๋ฒ•์„ ๋ฐฐ์šฐ๊ณ  ์‹ถ์–ด์š”" | โœ… ํ•™์Šต ๋„๊ตฌ๋กœ ํ™œ์šฉ ๊ฐ€๋Šฅ |
19
+ | Problem | Solution |
20
+ |---------|----------|
21
+ | ๐Ÿ˜ซ "Creating test files is tedious" | โœ… Auto-generate boilerplate |
22
+ | ๐Ÿค” "I don't know how to start" | โœ… Provide a working starting point |
23
+ | ๐Ÿ˜ฐ "I don't even have basic render tests" | โœ… Provide minimal safety net |
24
+ | ๐Ÿ“š "I want to learn how to write tests" | โœ… Use as a learning tool |
25
25
 
26
- ### ์ด ๋„๊ตฌ์˜ ํ•œ๊ณ„
26
+ ### Limitations
27
27
 
28
28
  ```
29
- โŒ ๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง ํ…Œ์ŠคํŠธ ์ž๋™ ์ƒ์„ฑ โ†’ ๊ฐœ๋ฐœ์ž๊ฐ€ ์ง์ ‘ ์ž‘์„ฑ ํ•„์š”
30
- โŒ ์™„๋ฒฝํ•œ ํ…Œ์ŠคํŠธ ์ปค๋ฒ„๋ฆฌ์ง€ โ†’ ๋ถˆ๊ฐ€๋Šฅ (80% ๋ณด์ผ๋Ÿฌํ”Œ๋ ˆ์ดํŠธ, 20% ์ง์ ‘ ์ž‘์„ฑ)
29
+ โŒ Auto-generate business logic tests โ†’ Developers must write these
30
+ โŒ Perfect test coverage โ†’ Not possible (80% boilerplate, 20% manual)
31
31
  ```
32
32
 
33
33
  ---
34
34
 
35
- ## ๐Ÿ“ฆ ์„ค์น˜ (Installation)
35
+ ## ๐Ÿ“ฆ Installation
36
36
 
37
37
  ```bash
38
- # ์ „์—ญ ์„ค์น˜
38
+ # Global installation
39
39
  npm install -g test-gen-js
40
40
 
41
- # ๋˜๋Š” npx๋กœ ๋ฐ”๋กœ ์‚ฌ์šฉ (์„ค์น˜ ์—†์ด)
41
+ # Or use with npx (no installation required)
42
42
  npx test-gen-js generate src/components/Button.tsx
43
43
 
44
- # ๋˜๋Š” ํ”„๋กœ์ ํŠธ devDependency๋กœ ์„ค์น˜
44
+ # Or install as devDependency
45
45
  npm install -D test-gen-js
46
46
  ```
47
47
 
48
48
  ---
49
49
 
50
- ## ๐Ÿš€ ๋น ๋ฅธ ์‹œ์ž‘ (Quick Start)
50
+ ## ๐Ÿš€ Quick Start
51
51
 
52
- ### 1. React ์ปดํฌ๋„ŒํŠธ ํ…Œ์ŠคํŠธ ์ƒ์„ฑ
52
+ ### 1. Generate React Component Tests
53
53
 
54
- **์ž…๋ ฅ: `src/components/Button.tsx`**
54
+ **Input: `src/components/Button.tsx`**
55
55
 
56
56
  ```tsx
57
57
  import React from 'react';
@@ -72,13 +72,13 @@ export const Button = ({ title, onPress, disabled = false, loading = false }: Bu
72
72
  };
73
73
  ```
74
74
 
75
- **๋ช…๋ น์–ด ์‹คํ–‰:**
75
+ **Run command:**
76
76
 
77
77
  ```bash
78
78
  npx test-gen-js generate src/components/Button.tsx
79
79
  ```
80
80
 
81
- **์ถœ๋ ฅ: `src/components/Button.test.tsx`**
81
+ **Output: `src/components/Button.test.tsx`**
82
82
 
83
83
  ```tsx
84
84
  import React from 'react';
@@ -120,9 +120,9 @@ describe('Button', () => {
120
120
 
121
121
  ---
122
122
 
123
- ### 2. React Native ์ปดํฌ๋„ŒํŠธ ํ…Œ์ŠคํŠธ ์ƒ์„ฑ
123
+ ### 2. Generate React Native Component Tests
124
124
 
125
- **์ž…๋ ฅ: `src/components/Card.tsx`**
125
+ **Input: `src/components/Card.tsx`**
126
126
 
127
127
  ```tsx
128
128
  import React, { useState } from 'react';
@@ -152,13 +152,13 @@ const styles = StyleSheet.create({
152
152
  });
153
153
  ```
154
154
 
155
- **๋ช…๋ น์–ด ์‹คํ–‰:**
155
+ **Run command:**
156
156
 
157
157
  ```bash
158
158
  npx test-gen-js generate src/components/Card.tsx --snapshot
159
159
  ```
160
160
 
161
- **์ถœ๋ ฅ: `src/components/Card.test.tsx`**
161
+ **Output: `src/components/Card.test.tsx`**
162
162
 
163
163
  ```tsx
164
164
  import React from 'react';
@@ -203,9 +203,9 @@ describe('Card', () => {
203
203
 
204
204
  ---
205
205
 
206
- ### 3. ์ผ๋ฐ˜ ํ•จ์ˆ˜ ํ…Œ์ŠคํŠธ ์ƒ์„ฑ
206
+ ### 3. Generate Function Tests
207
207
 
208
- **์ž…๋ ฅ: `src/utils/calculate.ts`**
208
+ **Input: `src/utils/calculate.ts`**
209
209
 
210
210
  ```typescript
211
211
  export function calculateDiscount(price: number, discountRate: number): number {
@@ -221,13 +221,13 @@ export async function fetchUserData(userId: string): Promise<User> {
221
221
  }
222
222
  ```
223
223
 
224
- **๋ช…๋ น์–ด ์‹คํ–‰:**
224
+ **Run command:**
225
225
 
226
226
  ```bash
227
227
  npx test-gen-js generate src/utils/calculate.ts
228
228
  ```
229
229
 
230
- **์ถœ๋ ฅ: `src/utils/calculate.test.ts`**
230
+ **Output: `src/utils/calculate.test.ts`**
231
231
 
232
232
  ```typescript
233
233
  import { calculateDiscount, fetchUserData } from './calculate';
@@ -279,58 +279,58 @@ describe('fetchUserData', () => {
279
279
 
280
280
  ---
281
281
 
282
- ## ๐Ÿ“‹ CLI ๋ช…๋ น์–ด
282
+ ## ๐Ÿ“‹ CLI Commands
283
283
 
284
- ### `generate` (๋ณ„์นญ: `g`)
284
+ ### `generate` (alias: `g`)
285
285
 
286
- ๋‹จ์ผ ํŒŒ์ผ์—์„œ ํ…Œ์ŠคํŠธ ์ƒ์„ฑ
286
+ Generate tests for a single file
287
287
 
288
288
  ```bash
289
- # ๊ธฐ๋ณธ ์‚ฌ์šฉ
289
+ # Basic usage
290
290
  test-gen-js generate <file>
291
291
  tgjs g <file>
292
292
 
293
- # ์˜ต์…˜
294
- --output, -o <path> # ์ถœ๋ ฅ ํŒŒ์ผ ๊ฒฝ๋กœ ์ง€์ •
295
- --template, -t <type> # ํ…œํ”Œ๋ฆฟ ํƒ€์ž… (component | function | hook)
296
- --snapshot # ์Šค๋ƒ…์ƒท ํ…Œ์ŠคํŠธ ํฌํ•จ
297
- --mock # Mock ์ž๋™ ์ƒ์„ฑ (๊ธฐ๋ณธ: true)
298
- --overwrite # ๊ธฐ์กด ํŒŒ์ผ ๋ฎ์–ด์“ฐ๊ธฐ
293
+ # Options
294
+ --output, -o <path> # Specify output file path
295
+ --template, -t <type> # Template type (component | function | hook)
296
+ --snapshot # Include snapshot tests
297
+ --mock # Auto-generate mocks (default: true)
298
+ --overwrite # Overwrite existing file
299
299
  ```
300
300
 
301
- **์˜ˆ์‹œ:**
301
+ **Examples:**
302
302
 
303
303
  ```bash
304
- # ๊ธฐ๋ณธ ์ƒ์„ฑ
304
+ # Basic generation
305
305
  tgjs g src/components/Header.tsx
306
306
 
307
- # ์Šค๋ƒ…์ƒท ํ…Œ์ŠคํŠธ ํฌํ•จ
307
+ # Include snapshot tests
308
308
  tgjs g src/components/Header.tsx --snapshot
309
309
 
310
- # ์ปค์Šคํ…€ ์ถœ๋ ฅ ๊ฒฝ๋กœ
310
+ # Custom output path
311
311
  tgjs g src/components/Header.tsx -o __tests__/Header.test.tsx
312
312
 
313
- # ๊ธฐ์กด ํŒŒ์ผ ๋ฎ์–ด์“ฐ๊ธฐ
313
+ # Overwrite existing file
314
314
  tgjs g src/components/Header.tsx --overwrite
315
315
  ```
316
316
 
317
- ### `scan` (๋ณ„์นญ: `s`) - v0.2.0 ์˜ˆ์ •
317
+ ### `scan` (alias: `s`) - Coming in v0.2.0
318
318
 
319
- ๋””๋ ‰ํ† ๋ฆฌ ์ „์ฒด ์Šค์บ” ๋ฐ ์ผ๊ด„ ์ƒ์„ฑ
319
+ Scan directory and generate tests for all files
320
320
 
321
321
  ```bash
322
- # ๊ธฐ๋ณธ ์‚ฌ์šฉ
322
+ # Basic usage
323
323
  test-gen-js scan <directory>
324
324
 
325
- # ์˜ต์…˜
326
- --dry-run # ๋ฏธ๋ฆฌ๋ณด๊ธฐ (ํŒŒ์ผ ์ƒ์„ฑ ์•ˆ ํ•จ)
327
- --pattern <glob> # ํŒŒ์ผ ํŒจํ„ด (๊ธฐ๋ณธ: **/*.{ts,tsx,js,jsx})
328
- --exclude <patterns> # ์ œ์™ธ ํŒจํ„ด
325
+ # Options
326
+ --dry-run # Preview without creating files
327
+ --pattern <glob> # File pattern (default: **/*.{ts,tsx,js,jsx})
328
+ --exclude <patterns> # Patterns to exclude
329
329
  ```
330
330
 
331
- ### `init` - v0.2.0 ์˜ˆ์ •
331
+ ### `init` - Coming in v0.2.0
332
332
 
333
- ์„ค์ • ํŒŒ์ผ ์ดˆ๊ธฐํ™”
333
+ Initialize configuration file
334
334
 
335
335
  ```bash
336
336
  test-gen-js init
@@ -338,29 +338,29 @@ test-gen-js init
338
338
 
339
339
  ---
340
340
 
341
- ## ๐Ÿ“Š ์ง€์› ๋ฒ”์œ„
341
+ ## ๐Ÿ“Š Supported Types
342
342
 
343
- | ํƒ€์ž… | ์ง€์› ์—ฌ๋ถ€ | ํ…Œ์ŠคํŠธ ํ”„๋ ˆ์ž„์›Œํฌ | ๋น„๊ณ  |
344
- |------|----------|-----------------|------|
345
- | JavaScript ํ•จ์ˆ˜ | โœ… | Jest | |
346
- | TypeScript ํ•จ์ˆ˜ | โœ… | Jest | ํƒ€์ž… ๋ถ„์„ ์ง€์› |
347
- | React ์ปดํฌ๋„ŒํŠธ | โœ… | Jest + @testing-library/react | |
348
- | React Native ์ปดํฌ๋„ŒํŠธ | โœ… | Jest + @testing-library/react-native | |
343
+ | Type | Support | Test Framework | Notes |
344
+ |------|---------|----------------|-------|
345
+ | JavaScript functions | โœ… | Jest | |
346
+ | TypeScript functions | โœ… | Jest | Type analysis supported |
347
+ | React components | โœ… | Jest + @testing-library/react | |
348
+ | React Native components | โœ… | Jest + @testing-library/react-native | |
349
349
  | Custom Hooks | โœ… | Jest + @testing-library/react-hooks | |
350
- | Node.js ๋ชจ๋“ˆ | ๐Ÿ”œ v0.2 | Jest | |
351
- | Express ํ•ธ๋“ค๋Ÿฌ | ๐Ÿ”œ v0.2 | Jest + supertest | |
352
- | Vue ์ปดํฌ๋„ŒํŠธ | ๐Ÿ”œ ํ”Œ๋Ÿฌ๊ทธ์ธ | Vitest | |
353
- | Angular ์ปดํฌ๋„ŒํŠธ | ๐Ÿ”œ ํ”Œ๋Ÿฌ๊ทธ์ธ | Jasmine | |
350
+ | Node.js modules | ๐Ÿ”œ v0.2 | Jest | |
351
+ | Express handlers | ๐Ÿ”œ v0.2 | Jest + supertest | |
352
+ | Vue components | ๐Ÿ”œ Plugin | Vitest | |
353
+ | Angular components | ๐Ÿ”œ Plugin | Jasmine | |
354
354
 
355
355
  ---
356
356
 
357
- ## ๐Ÿ”ง ์ž‘๋™ ์›๋ฆฌ
357
+ ## ๐Ÿ”ง How It Works
358
358
 
359
- ### AST (Abstract Syntax Tree) ๋ถ„์„
359
+ ### AST (Abstract Syntax Tree) Analysis
360
360
 
361
361
  ```
362
362
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
363
- โ”‚ 1. ์ž…๋ ฅ: Button.tsx โ”‚
363
+ โ”‚ 1. Input: Button.tsx โ”‚
364
364
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
365
365
  โ”‚ export const Button = ({ title, onPress, disabled }) => { โ”‚
366
366
  โ”‚ const [loading, setLoading] = useState(false); โ”‚
@@ -374,7 +374,7 @@ test-gen-js init
374
374
  โ”‚
375
375
  โ–ผ Babel Parser
376
376
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
377
- โ”‚ 2. AST ๋ถ„์„ ๊ฒฐ๊ณผ โ”‚
377
+ โ”‚ 2. AST Analysis Result โ”‚
378
378
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
379
379
  โ”‚ { โ”‚
380
380
  โ”‚ name: "Button", โ”‚
@@ -392,7 +392,7 @@ test-gen-js init
392
392
  โ”‚
393
393
  โ–ผ EJS Template
394
394
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
395
- โ”‚ 3. ์ถœ๋ ฅ: Button.test.tsx โ”‚
395
+ โ”‚ 3. Output: Button.test.tsx โ”‚
396
396
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
397
397
  โ”‚ describe('Button', () => { โ”‚
398
398
  โ”‚ const defaultProps = { title: '...', onPress: jest.fn() }; โ”‚
@@ -403,90 +403,90 @@ test-gen-js init
403
403
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
404
404
  ```
405
405
 
406
- ### ์ž๋™ํ™” ๋ฒ”์œ„
406
+ ### Automation Coverage
407
407
 
408
- | ์˜์—ญ | ์ž๋™ํ™” ์ˆ˜์ค€ | ์„ค๋ช… |
409
- |------|------------|------|
410
- | import ๋ฌธ | โœ… 100% | ํ”„๋ ˆ์ž„์›Œํฌ ์ž๋™ ๊ฐ์ง€ |
411
- | describe/it ๊ตฌ์กฐ | โœ… 100% | ์ปดํฌ๋„ŒํŠธ/ํ•จ์ˆ˜๋ช… ๊ธฐ๋ฐ˜ |
412
- | defaultProps ์ƒ์„ฑ | โœ… 80% | TypeScript ํƒ€์ž… ๋ถ„์„ |
413
- | Mock ์„ค์ • | โœ… 70% | ์ฃผ์š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ž๋™ ๊ฐ์ง€ |
414
- | ๋ Œ๋”๋ง ํ…Œ์ŠคํŠธ | โœ… 100% | ๊ธฐ๋ณธ ์ œ๊ณต |
415
- | ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ ํ…Œ์ŠคํŠธ | โœ… 60% | onPress, onClick ๋“ฑ ๊ฐ์ง€ |
416
- | Hook ํ…Œ์ŠคํŠธ | โœ… 50% | useState, useEffect ๋“ฑ ๊ฐ์ง€ |
417
- | **๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง ํ…Œ์ŠคํŠธ** | โŒ 0% | **๊ฐœ๋ฐœ์ž ์ง์ ‘ ์ž‘์„ฑ ํ•„์š”** |
408
+ | Area | Automation Level | Description |
409
+ |------|------------------|-------------|
410
+ | Import statements | โœ… 100% | Auto-detect framework |
411
+ | describe/it structure | โœ… 100% | Based on component/function name |
412
+ | defaultProps generation | โœ… 80% | TypeScript type analysis |
413
+ | Mock setup | โœ… 70% | Auto-detect major libraries |
414
+ | Render tests | โœ… 100% | Always provided |
415
+ | Event handler tests | โœ… 60% | Detect onPress, onClick, etc. |
416
+ | Hook tests | โœ… 50% | Detect useState, useEffect, etc. |
417
+ | **Business logic tests** | โŒ 0% | **Developer must write** |
418
418
 
419
419
  ---
420
420
 
421
- ## ๐Ÿ—บ๏ธ ๋กœ๋“œ๋งต (Roadmap)
421
+ ## ๐Ÿ—บ๏ธ Roadmap
422
422
 
423
- ### โœ… 1๋‹จ๊ณ„: MVP (v0.1.x) - ํ˜„์žฌ
423
+ ### โœ… Phase 1: MVP (v0.1.x) - Current
424
424
 
425
- - [x] ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ ์„ค์ •
426
- - [x] AST ํŒŒ์„œ ๊ตฌํ˜„ (Babel ๊ธฐ๋ฐ˜)
427
- - [x] CLI ์ธํ„ฐํŽ˜์ด์Šค (commander)
428
- - [x] ๊ธฐ๋ณธ ํ…Œ์ŠคํŠธ ์ƒ์„ฑ๊ธฐ
429
- - [x] React ์ปดํฌ๋„ŒํŠธ
430
- - [x] React Native ์ปดํฌ๋„ŒํŠธ
431
- - [x] JavaScript/TypeScript ํ•จ์ˆ˜
432
- - [x] EJS ํ…œํ”Œ๋ฆฟ ์‹œ์Šคํ…œ
425
+ - [x] Project structure setup
426
+ - [x] AST parser implementation (Babel-based)
427
+ - [x] CLI interface (commander)
428
+ - [x] Basic test generator
429
+ - [x] React components
430
+ - [x] React Native components
431
+ - [x] JavaScript/TypeScript functions
432
+ - [x] EJS template system
433
433
  - [x] GitHub Actions CI/CD
434
- - [x] npm ์ž๋™ ํผ๋ธ”๋ฆฌ์‹œ
434
+ - [x] Automated npm publishing
435
435
 
436
- ### ๐Ÿ”œ 2๋‹จ๊ณ„: ํ™•์žฅ (v0.2.x)
436
+ ### ๐Ÿ”œ Phase 2: Extended Features (v0.2.x)
437
437
 
438
- - [ ] ๋””๋ ‰ํ† ๋ฆฌ ์Šค์บ” ๋ฐ ์ผ๊ด„ ์ƒ์„ฑ (`scan` ๋ช…๋ น์–ด)
439
- - [ ] ์„ค์ • ํŒŒ์ผ ์ง€์› (`.testgenrc.js`)
440
- - [ ] Node.js ๋ฐฑ์—”๋“œ ์ง€์›
441
- - [ ] Mock ์ž๋™ ์ƒ์„ฑ ๊ฐœ์„ 
442
- - [ ] Prettier/ESLint ์—ฐ๋™
443
- - [ ] Watch ๋ชจ๋“œ
444
- - [ ] ์ปค์Šคํ…€ ํ…œํ”Œ๋ฆฟ ์ง€์›
438
+ - [ ] Directory scanning and batch generation (`scan` command)
439
+ - [ ] Configuration file support (`.testgenrc.js`)
440
+ - [ ] Node.js backend support
441
+ - [ ] Improved mock generation
442
+ - [ ] Prettier/ESLint integration
443
+ - [ ] Watch mode
444
+ - [ ] Custom template support
445
445
 
446
- ### ๐Ÿ”ฎ 3๋‹จ๊ณ„: ํ”Œ๋Ÿฌ๊ทธ์ธ ์‹œ์Šคํ…œ (v0.3.x+)
446
+ ### ๐Ÿ”ฎ Phase 3: Plugin System (v0.3.x+)
447
447
 
448
- - [ ] ํ”Œ๋Ÿฌ๊ทธ์ธ ์•„ํ‚คํ…์ฒ˜
449
- - [ ] Vue.js ํ”Œ๋Ÿฌ๊ทธ์ธ
450
- - [ ] Angular ํ”Œ๋Ÿฌ๊ทธ์ธ
451
- - [ ] VS Code ํ™•์žฅ
452
- - [ ] AI ํ†ตํ•ฉ (์„ ํƒ์ )
448
+ - [ ] Plugin architecture
449
+ - [ ] Vue.js plugin
450
+ - [ ] Angular plugin
451
+ - [ ] VS Code extension
452
+ - [ ] AI integration (optional)
453
453
 
454
454
  ---
455
455
 
456
- ## ๐Ÿ“ ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ
456
+ ## ๐Ÿ“ Project Structure
457
457
 
458
458
  ```
459
459
  test-gen-js/
460
460
  โ”œโ”€โ”€ bin/
461
- โ”‚ โ””โ”€โ”€ cli.js # CLI ์ง„์ž…์ 
461
+ โ”‚ โ””โ”€โ”€ cli.js # CLI entry point
462
462
  โ”œโ”€โ”€ src/
463
- โ”‚ โ”œโ”€โ”€ index.ts # ๋ฉ”์ธ export
464
- โ”‚ โ”œโ”€โ”€ cli.ts # CLI ๋กœ์ง (commander)
465
- โ”‚ โ”œโ”€โ”€ types.ts # TypeScript ํƒ€์ž… ์ •์˜
463
+ โ”‚ โ”œโ”€โ”€ index.ts # Main exports
464
+ โ”‚ โ”œโ”€โ”€ cli.ts # CLI logic (commander)
465
+ โ”‚ โ”œโ”€โ”€ types.ts # TypeScript type definitions
466
466
  โ”‚ โ”œโ”€โ”€ analyzer/
467
467
  โ”‚ โ”‚ โ”œโ”€โ”€ index.ts
468
- โ”‚ โ”‚ โ”œโ”€โ”€ fileAnalyzer.ts # ํŒŒ์ผ ๋ถ„์„ ๋ฉ”์ธ
469
- โ”‚ โ”‚ โ”œโ”€โ”€ componentAnalyzer.ts # React ์ปดํฌ๋„ŒํŠธ ๋ถ„์„
470
- โ”‚ โ”‚ โ””โ”€โ”€ functionAnalyzer.ts # ํ•จ์ˆ˜ ๋ถ„์„
468
+ โ”‚ โ”‚ โ”œโ”€โ”€ fileAnalyzer.ts # Main file analysis
469
+ โ”‚ โ”‚ โ”œโ”€โ”€ componentAnalyzer.ts # React component analysis
470
+ โ”‚ โ”‚ โ””โ”€โ”€ functionAnalyzer.ts # Function analysis
471
471
  โ”‚ โ”œโ”€โ”€ parser/
472
472
  โ”‚ โ”‚ โ”œโ”€โ”€ index.ts
473
- โ”‚ โ”‚ โ”œโ”€โ”€ astParser.ts # Babel AST ํŒŒ์‹ฑ
474
- โ”‚ โ”‚ โ””โ”€โ”€ typeExtractor.ts # TypeScript ํƒ€์ž… ์ถ”์ถœ
473
+ โ”‚ โ”‚ โ”œโ”€โ”€ astParser.ts # Babel AST parsing
474
+ โ”‚ โ”‚ โ””โ”€โ”€ typeExtractor.ts # TypeScript type extraction
475
475
  โ”‚ โ”œโ”€โ”€ generator/
476
476
  โ”‚ โ”‚ โ”œโ”€โ”€ index.ts
477
- โ”‚ โ”‚ โ”œโ”€โ”€ testGenerator.ts # ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ์ƒ์„ฑ
478
- โ”‚ โ”‚ โ””โ”€โ”€ mockGenerator.ts # Mock ์ฝ”๋“œ ์ƒ์„ฑ
477
+ โ”‚ โ”‚ โ”œโ”€โ”€ testGenerator.ts # Test code generation
478
+ โ”‚ โ”‚ โ””โ”€โ”€ mockGenerator.ts # Mock code generation
479
479
  โ”‚ โ”œโ”€โ”€ templates/
480
- โ”‚ โ”‚ โ”œโ”€โ”€ component.ejs # ์ปดํฌ๋„ŒํŠธ ํ…Œ์ŠคํŠธ ํ…œํ”Œ๋ฆฟ
481
- โ”‚ โ”‚ โ”œโ”€โ”€ function.ejs # ํ•จ์ˆ˜ ํ…Œ์ŠคํŠธ ํ…œํ”Œ๋ฆฟ
482
- โ”‚ โ”‚ โ””โ”€โ”€ snapshot.ejs # ์Šค๋ƒ…์ƒท ํ…Œ์ŠคํŠธ ํ…œํ”Œ๋ฆฟ
480
+ โ”‚ โ”‚ โ”œโ”€โ”€ component.ejs # Component test template
481
+ โ”‚ โ”‚ โ”œโ”€โ”€ function.ejs # Function test template
482
+ โ”‚ โ”‚ โ””โ”€โ”€ snapshot.ejs # Snapshot test template
483
483
  โ”‚ โ””โ”€โ”€ utils/
484
- โ”‚ โ”œโ”€โ”€ fileUtils.ts # ํŒŒ์ผ ์œ ํ‹ธ๋ฆฌํ‹ฐ
485
- โ”‚ โ””โ”€โ”€ naming.ts # ๋„ค์ด๋ฐ ์œ ํ‹ธ๋ฆฌํ‹ฐ
484
+ โ”‚ โ”œโ”€โ”€ fileUtils.ts # File utilities
485
+ โ”‚ โ””โ”€โ”€ naming.ts # Naming utilities
486
486
  โ”œโ”€โ”€ .github/
487
487
  โ”‚ โ””โ”€โ”€ workflows/
488
- โ”‚ โ”œโ”€โ”€ ci.yml # CI (๋นŒ๋“œ/ํ…Œ์ŠคํŠธ)
489
- โ”‚ โ””โ”€โ”€ publish.yml # npm ์ž๋™ ํผ๋ธ”๋ฆฌ์‹œ
488
+ โ”‚ โ”œโ”€โ”€ ci.yml # CI (build/test)
489
+ โ”‚ โ””โ”€โ”€ publish.yml # Automated npm publish
490
490
  โ”œโ”€โ”€ package.json
491
491
  โ”œโ”€โ”€ tsconfig.json
492
492
  โ””โ”€โ”€ README.md
@@ -494,11 +494,11 @@ test-gen-js/
494
494
 
495
495
  ---
496
496
 
497
- ## ๐Ÿค ๊ธฐ์—ฌํ•˜๊ธฐ (Contributing)
497
+ ## ๐Ÿค Contributing
498
498
 
499
- ๊ธฐ์—ฌ๋Š” ์–ธ์ œ๋‚˜ ํ™˜์˜ํ•ฉ๋‹ˆ๋‹ค!
499
+ Contributions are always welcome!
500
500
 
501
- ### ๊ธฐ์—ฌ ๋ฐฉ๋ฒ•
501
+ ### How to Contribute
502
502
 
503
503
  1. ๐Ÿด Fork the repository
504
504
  2. ๐ŸŒฟ Create your feature branch (`git checkout -b feature/amazing-feature`)
@@ -506,33 +506,33 @@ test-gen-js/
506
506
  4. ๐Ÿ“ค Push to the branch (`git push origin feature/amazing-feature`)
507
507
  5. ๐Ÿ”ƒ Open a Pull Request
508
508
 
509
- ### ๊ธฐ์—ฌ ์œ ํ˜•
509
+ ### Types of Contributions
510
510
 
511
- - ๐Ÿ› ๋ฒ„๊ทธ ๋ฆฌํฌํŠธ
512
- - ๐Ÿ’ก ๊ธฐ๋Šฅ ์ œ์•ˆ
513
- - ๐Ÿ“ ๋ฌธ์„œ ๊ฐœ์„ 
514
- - ๐Ÿ”ง ์ฝ”๋“œ ๊ธฐ์—ฌ
515
- - ๐ŸŒ ๋ฒˆ์—ญ
511
+ - ๐Ÿ› Bug reports
512
+ - ๐Ÿ’ก Feature requests
513
+ - ๐Ÿ“ Documentation improvements
514
+ - ๐Ÿ”ง Code contributions
515
+ - ๐ŸŒ Translations
516
516
 
517
517
  ---
518
518
 
519
- ## ๐Ÿ“„ ๋ผ์ด์„ ์Šค (License)
519
+ ## ๐Ÿ“„ License
520
520
 
521
- MIT License - ์ž์œ ๋กญ๊ฒŒ ์‚ฌ์šฉ, ์ˆ˜์ •, ๋ฐฐํฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
521
+ MIT License - Feel free to use, modify, and distribute.
522
522
 
523
523
  ---
524
524
 
525
- ## ๐Ÿ™ ๊ฐ์‚ฌ์˜ ๊ธ€ (Acknowledgments)
525
+ ## ๐Ÿ™ Acknowledgments
526
526
 
527
- - [Babel](https://babeljs.io/) - JavaScript AST ํŒŒ์‹ฑ
528
- - [Jest](https://jestjs.io/) - ํ…Œ์ŠคํŠธ ํ”„๋ ˆ์ž„์›Œํฌ
529
- - [Testing Library](https://testing-library.com/) - ํ…Œ์ŠคํŠธ ์œ ํ‹ธ๋ฆฌํ‹ฐ
530
- - [Commander.js](https://github.com/tj/commander.js) - CLI ํ”„๋ ˆ์ž„์›Œํฌ
531
- - [EJS](https://ejs.co/) - ํ…œํ”Œ๋ฆฟ ์—”์ง„
527
+ - [Babel](https://babeljs.io/) - JavaScript AST parsing
528
+ - [Jest](https://jestjs.io/) - Testing framework
529
+ - [Testing Library](https://testing-library.com/) - Testing utilities
530
+ - [Commander.js](https://github.com/tj/commander.js) - CLI framework
531
+ - [EJS](https://ejs.co/) - Template engine
532
532
 
533
533
  ---
534
534
 
535
- ## ๐Ÿ“ž ๋ฌธ์˜ (Contact)
535
+ ## ๐Ÿ“ž Contact
536
536
 
537
537
  - GitHub Issues: [https://github.com/liveforownhappiness/test-gen-js/issues](https://github.com/liveforownhappiness/test-gen-js/issues)
538
538
  - npm: [https://www.npmjs.com/package/test-gen-js](https://www.npmjs.com/package/test-gen-js)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-gen-js",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Auto-generate test boilerplate code for JavaScript/TypeScript, React, and React Native projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",