forked from PaulHatch/semantic-version
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.test.js
667 lines (487 loc) · 21.2 KB
/
index.test.js
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
const cp = require('child_process');
const path = require('path');
const process = require('process');
const os = require('os');
const windows = process.platform === "win32";
// Action input variables
const defaultInputs = {
test_value: ".",
branch: "HEAD",
tag_prefix: "v",
major_pattern: "(MAJOR)",
minor_pattern: "(MINOR)",
format: "${major}.${minor}.${patch}",
short_tags: true,
use_test_value: false
};
// Creates a randomly named git repository and returns a function to execute commands in it
const createTestRepo = (inputs) => {
const repoDirectory = path.join(os.tmpdir(), `test${Math.random().toString(36).substring(2, 15)}`);
cp.execSync(`mkdir ${repoDirectory}`);
cp.execSync(`git init ${repoDirectory}`);
const run = (command, extraInputs) => {
const allInputs = Object.assign({ ...defaultInputs }, inputs, extraInputs);
let env = {};
for (let key in allInputs) {
env[`INPUT_${key.toUpperCase()}`] = allInputs[key];
}
return execute(repoDirectory, command, env);
}
// Configure up git user
run(`git config user.name "Test User"`);
run(`git config user.email "[email protected]"`);
let i = 1;
return {
clean: () => execute(os.tmpdir(), windows ? `rmdir /s /q ${repoDirectory}` : `rm -rf ${repoDirectory}`),
makeCommit: (msg, path) => {
if (windows) {
run(`fsutil file createnew ${path !== undefined ? path.trim('/') + '/' : ''}test${i++} 0`);
} else {
run(`touch ${path !== undefined ? path.trim('/') + '/' : ''}test${i++}`);
}
run(`git add --all`);
run(`git commit -m "${msg}"`);
},
runAction: (inputs) => run(`node ${path.join(__dirname, 'index.js')}`, inputs),
exec: run
};
};
// Executes a set of commands in the specified directory
const execute = (workingDirectory, command, env) => {
try {
return String(cp.execSync(command, { env: { ...process.env, ...env }, cwd: workingDirectory }));
}
catch (e) {
console.error(String(e.stdout));
console.error(String(e.stderr));
throw e;
}
};
test('Empty repository version is correct', () => {
const repo = createTestRepo(); // 0.0.0+0
var result = repo.runAction();
expect(result).toMatch('Version is 0.0.0+0');
repo.clean();
});
test('Repository with commits shows increment', () => {
const repo = createTestRepo(); // 0.0.0+0
repo.makeCommit('Initial Commit'); // 0.0.1+0
repo.makeCommit(`Second Commit`); // 0.0.1+1
const result = repo.runAction();
expect(result).toMatch('Version is 0.0.1+1');
repo.clean();
});
test('Repository show commit for checked out commit', () => {
const repo = createTestRepo(); // 0.0.0+0
repo.makeCommit('Initial Commit'); // 0.0.1+0
repo.makeCommit(`Second Commit`); // 0.0.1+1
let result = repo.runAction();
expect(result).toMatch('Version is 0.0.1+1');
repo.exec(`git checkout HEAD~1`); // 0.0.1+1
result = repo.runAction();
expect(result).toMatch('Version is 0.0.1+0');
repo.clean();
});
test('Tagging does not break version', () => {
const repo = createTestRepo(); // 0.0.0+0
repo.makeCommit('Initial Commit'); // 0.0.1+0
repo.makeCommit(`Second Commit`); // 0.0.1+1
repo.makeCommit(`Third Commit`); // 0.0.1+2
repo.exec('git tag v0.0.1')
const result = repo.runAction();
expect(result).toMatch('Version is 0.0.1+2');
repo.clean();
});
test('Minor update bumps minor version and resets increment', () => {
const repo = createTestRepo(); // 0.0.0+0
repo.makeCommit('Initial Commit'); // 0.0.1+0
repo.makeCommit('Second Commit (MINOR)'); // 0.1.0+0
const result = repo.runAction();
expect(result).toMatch('Version is 0.1.0+0');
repo.clean();
});
test('Major update bumps major version and resets increment', () => {
const repo = createTestRepo(); // 0.0.0+0
repo.makeCommit('Initial Commit'); // 0.0.1+0
repo.makeCommit('Second Commit (MAJOR)'); // 1.0.0+0
const result = repo.runAction();
expect(result).toMatch('Version is 1.0.0+0');
repo.clean();
});
test('Multiple major commits are idempotent', () => {
const repo = createTestRepo(); // 0.0.0+0
repo.makeCommit('Initial Commit'); // 0.0.1+0
repo.makeCommit('Second Commit (MAJOR)'); // 1.0.0+0
repo.makeCommit('Third Commit (MAJOR)'); // 1.0.0+1
const result = repo.runAction();
expect(result).toMatch('Version is 1.0.0+1');
repo.clean();
});
test('Minor commits after a major commit are ignored', () => {
const repo = createTestRepo(); // 0.0.0+0
repo.makeCommit('Initial Commit'); // 0.0.1+0
repo.makeCommit('Second Commit (MAJOR)'); // 1.0.0+0
repo.makeCommit('Third Commit (MINOR)'); // 1.0.0+1
const result = repo.runAction();
expect(result).toMatch('Version is 1.0.0+1');
repo.clean();
});
test('Tags start new version', () => {
const repo = createTestRepo(); // 0.0.0+0
repo.makeCommit('Initial Commit'); // 0.0.1+0
repo.makeCommit('Second Commit'); // 0.0.1+1
repo.exec('git tag v0.0.1');
repo.makeCommit('Third Commit'); // 0.0.2+0
const result = repo.runAction();
expect(result).toMatch('Version is 0.0.2+0');
repo.clean();
});
test('Version pulled from last release branch', () => {
const repo = createTestRepo(); // 0.0.0+0
repo.makeCommit('Initial Commit'); // 0.0.1+0
repo.exec('git tag v0.0.1');
repo.makeCommit('Second Commit'); // 0.0.2+0
repo.exec('git tag v5.6.7');
repo.makeCommit('Third Commit'); // 5.6.7+0
const result = repo.runAction();
expect(result).toMatch('Version is 5.6.8+0');
repo.clean();
});
/* Removed for now
test('Tags on branches are used', () => {
// This test checks that tags are counted correctly even if they are not on
// the main branch:
// master o--o--o--o <- expecting v0.0.2
// \
// release o--o <- taged v0.0.1
const repo = createTestRepo(); // 0.0.0+0
repo.makeCommit('Initial Commit'); // 0.0.1+0
repo.makeCommit('Second Commit'); // 0.0.1+1
repo.makeCommit('Third Commit'); // 0.1.1+2
repo.exec('git checkout -b release/0.0.1')
repo.makeCommit('Fourth Commit'); // 0.1.1+3
repo.exec('git tag v0.0.1');
repo.exec('git checkout master');
repo.makeCommit('Fifth Commit'); // 0.0.2.0
const result = repo.runAction();
expect(result).toMatch('Version is 0.0.2+0');
repo.clean();
});
*/
test('Merged tags do not affect version', () => {
// This test checks that merges don't override tags
// Tagged v0.0.2
// v
// master o--o--o---o---o <- expecting v0.0.3+1
// \ /
// release o---o <- taged v0.0.1
const repo = createTestRepo(); // 0.0.0+0
repo.makeCommit('Initial Commit'); // 0.0.1+0
repo.makeCommit('Second Commit'); // 0.0.1+1
repo.makeCommit('Third Commit'); // 0.1.1+2
repo.exec('git checkout -b release/0.0.1')
repo.makeCommit('Fourth Commit'); // 0.1.1+3
repo.exec('git tag v0.0.1');
repo.exec('git checkout master');
repo.makeCommit('Fifth Commit'); // 0.0.2.0
repo.exec('git tag v0.0.2');
repo.exec('git merge release/0.0.1');
const result = repo.runAction();
expect(result).toMatch('Version is 0.0.3+1');
repo.clean();
});
test('Version tags do not require all three version numbers', () => {
const repo = createTestRepo(); // 0.0.0+0
repo.makeCommit('Initial Commit (MAJOR)'); // 1.0.0+0
repo.exec('git tag v1');
repo.makeCommit(`Second Commit`); // 1.0.1+0
const result = repo.runAction();
expect(result).toMatch('Version is 1.0.1+0');
repo.clean();
});
test('Format input is respected', () => {
const repo = createTestRepo({ format: 'M${major}m${minor}p${patch}i${increment}' }); // M0m0p0i0
repo.makeCommit('Initial Commit'); // M1m2p3i0
repo.exec('git tag v1.2.3');
repo.makeCommit(`Second Commit`); // M1m2p4i0
const result = repo.runAction();
expect(result).toMatch('M1m2p4i0');
repo.clean();
});
test('Version prefixes are not required/can be empty', () => {
const repo = createTestRepo({ tag_prefix: '' }); // 0.0.0
repo.makeCommit('Initial Commit'); // 0.0.1
repo.exec('git tag 0.0.1');
repo.makeCommit(`Second Commit`); // 0.0.2
const result = repo.runAction();
expect(result).toMatch('Version is 0.0.2');
repo.clean();
});
test('Tag order comes from commit order, not tag create order', () => {
const repo = createTestRepo(); // 0.0.0+0
repo.makeCommit('Initial Commit'); // 0.0.1+0
repo.makeCommit('Second Commit'); // 0.0.1+1
repo.makeCommit('Third Commit'); // 0.0.1+2
repo.exec('git tag v2.0.0');
// Can't timeout in this context on Windows, ping localhost to delay
repo.exec(windows ? 'ping 127.0.0.1 -n 2' : 'sleep 2');
repo.exec('git tag v1.0.0 HEAD~1');
repo.makeCommit('Fourth Commit'); // 0.0.1+2
const result = repo.runAction();
expect(result).toMatch('Version is 2.0.1+0');
repo.clean();
});
test('Change detection is true by default', () => {
const repo = createTestRepo({ tag_prefix: '' }); // 0.0.0
repo.makeCommit('Initial Commit'); // 0.0.1
repo.exec('git tag 0.0.1');
repo.makeCommit(`Second Commit`); // 0.0.2
const result = repo.runAction();
expect(result).toMatch('::set-output name=changed::true');
repo.clean();
});
test('Changes to monitored path is true when change is in path', () => {
const repo = createTestRepo({ tag_prefix: '' }); // 0.0.0
repo.makeCommit('Initial Commit'); // 0.0.1
repo.exec('git tag 0.0.1');
repo.exec('mkdir project1');
repo.makeCommit(`Second Commit`, 'project1'); // 0.0.2
const result = repo.runAction({ change_path: "project1" });
expect(result).toMatch('::set-output name=changed::true');
repo.clean();
});
test('Changes to monitored path is false when changes are not in path', () => {
const repo = createTestRepo({ tag_prefix: '' }); // 0.0.0
repo.makeCommit('Initial Commit'); // 0.0.1
repo.exec('git tag 0.0.1');
repo.exec('mkdir project1');
repo.exec('mkdir project2');
repo.makeCommit(`Second Commit`, 'project2'); // 0.0.2
const result = repo.runAction({ change_path: "project1" });
expect(result).toMatch('::set-output name=changed::false');
repo.clean();
});
test('Changes can be detected without tags', () => {
const repo = createTestRepo({ tag_prefix: '' }); // 0.0.0
repo.makeCommit('Initial Commit'); // 0.0.1
repo.exec('mkdir project1');
repo.makeCommit(`Second Commit`, 'project1'); // 0.0.2
const result = repo.runAction({ change_path: "project1" });
expect(result).toMatch('::set-output name=changed::true');
repo.clean();
});
test('Changes to multiple monitored path is true when change is in path', () => {
const repo = createTestRepo({ tag_prefix: '' }); // 0.0.0
repo.makeCommit('Initial Commit'); // 0.0.1
repo.exec('git tag 0.0.1');
repo.exec('mkdir project1');
repo.exec('mkdir project2');
repo.makeCommit(`Second Commit`, 'project2'); // 0.0.2
const result = repo.runAction({ change_path: "project1 project2" });
expect(result).toMatch('::set-output name=changed::true');
repo.clean();
});
test('Changes to multiple monitored path is false when change is not in path', () => {
const repo = createTestRepo({ tag_prefix: '' }); // 0.0.0
repo.makeCommit('Initial Commit'); // 0.0.1
repo.exec('git tag 0.0.1');
repo.exec('mkdir project1');
repo.exec('mkdir project2');
repo.exec('mkdir project3');
repo.makeCommit(`Second Commit`, 'project3'); // 0.0.2
const result = repo.runAction({ change_path: "project1 project2" });
expect(result).toMatch('::set-output name=changed::false');
repo.clean();
});
test('Namespace is tracked separately', () => {
const repo = createTestRepo({ tag_prefix: '' }); // 0.0.0
repo.makeCommit('Initial Commit'); // 0.0.1
repo.exec('git tag 0.0.1');
repo.makeCommit('Second Commit'); // 0.0.2
repo.exec('git tag 0.1.0-subproject');
repo.makeCommit('Third Commit'); // 0.0.2 / 0.1.1
const result = repo.runAction();
const subprojectResult = repo.runAction({ namespace: "subproject" });
expect(result).toMatch('Version is 0.0.2+1');
expect(subprojectResult).toMatch('Version is 0.1.1+0');
repo.clean();
});
test('Commits outside of path are not counted', () => {
const repo = createTestRepo({ tag_prefix: '' }); // 0.0.0
repo.makeCommit('Initial Commit');
repo.makeCommit('Second Commit');
repo.makeCommit('Third Commit');
const result = repo.runAction({ change_path: "project1" });
expect(result).toMatch('Version is 0.0.1+0');
repo.clean();
});
test('Commits inside path are counted', () => {
const repo = createTestRepo({ tag_prefix: '' }); // 0.0.0
repo.makeCommit('Initial Commit');
repo.makeCommit('Second Commit');
repo.makeCommit('Third Commit');
repo.exec('mkdir project1');
repo.makeCommit('Fourth Commit', 'project1'); // 0.0.1+0
repo.makeCommit('Fifth Commit', 'project1'); // 0.0.1+1
repo.makeCommit('Sixth Commit', 'project1'); // 0.0.1+2
const result = repo.runAction({ change_path: "project1" });
expect(result).toMatch('Version is 0.0.1+2');
repo.clean();
});
test('Current tag is used', () => {
const repo = createTestRepo({ tag_prefix: '' }); // 0.0.0
repo.makeCommit('Initial Commit');
repo.makeCommit('Second Commit');
repo.makeCommit('Third Commit');
repo.exec('git tag 7.6.5');
const result = repo.runAction();
expect(result).toMatch('Version is 7.6.5+0');
repo.clean();
});
test('Short tag can be switched off', () => {
const repo = createTestRepo({ tag_prefix: '', short_tags: 'false' }); // 0.0.0
repo.makeCommit('Initial Commit');
repo.makeCommit('Second Commit');
repo.makeCommit('Third Commit');
repo.exec('git tag 7');
const result = repo.runAction();
expect(result).toMatch('Version is 0.0.1+2');
repo.clean();
});
test('Bump each commit works', () => {
const repo = createTestRepo({ tag_prefix: '', bump_each_commit: true }); // 0.0.0
expect(repo.runAction()).toMatch('Version is 0.0.0+0');
repo.makeCommit('Initial Commit');
expect(repo.runAction()).toMatch('Version is 0.0.1+0');
repo.makeCommit('Second Commit');
expect(repo.runAction()).toMatch('Version is 0.0.2+0');
repo.makeCommit('Third Commit');
expect(repo.runAction()).toMatch('Version is 0.0.3+0');
repo.makeCommit('Fourth Commit (MINOR)');
expect(repo.runAction()).toMatch('Version is 0.1.0+0');
repo.makeCommit('Fifth Commit');
expect(repo.runAction()).toMatch('Version is 0.1.1+0');
repo.makeCommit('Sixth Commit (MAJOR)');
expect(repo.runAction()).toMatch('Version is 1.0.0+0');
repo.makeCommit('Seventh Commit');
expect(repo.runAction()).toMatch('Version is 1.0.1+0');
repo.clean();
});
test('Bump each commit picks up tags', () => {
const repo = createTestRepo({ tag_prefix: '', bump_each_commit: true }); // 0.0.0
expect(repo.runAction()).toMatch('Version is 0.0.0+0');
repo.makeCommit('Initial Commit');
expect(repo.runAction()).toMatch('Version is 0.0.1+0');
repo.makeCommit('Second Commit');
expect(repo.runAction()).toMatch('Version is 0.0.2+0');
repo.makeCommit('Third Commit');
repo.exec('git tag 3.0.0');
expect(repo.runAction()).toMatch('Version is 3.0.0+0');
repo.makeCommit('Fourth Commit');
expect(repo.runAction()).toMatch('Version is 3.0.1+0');
repo.clean();
});
test('Increment not affected by matching tag', () => {
const repo = createTestRepo({ tag_prefix: '' }); // 0.0.1
repo.makeCommit('Initial Commit'); // 0.0.1+0
repo.makeCommit('Second Commit'); // 0.0.1+1
repo.exec('git tag 0.0.1');
expect(repo.runAction()).toMatch('Version is 0.0.1+1');
repo.clean();
});
test('Regular expressions can be used as major tag', () => {
const repo = createTestRepo({ tag_prefix: '', major_pattern: '/S[a-z]+Value/' }); // 0.0.1
repo.makeCommit('Initial Commit'); // 0.0.1+0
repo.makeCommit('Second Commit SomeValue'); // 0.0.1+1
expect(repo.runAction()).toMatch('Version is 1.0.0+0');
repo.clean();
});
test('Regular expressions can be used as minor tag', () => {
const repo = createTestRepo({ tag_prefix: '', minor_pattern: '/S[a-z]+Value/' }); // 0.0.1
repo.makeCommit('Initial Commit'); // 0.0.1+0
repo.makeCommit('Second Commit SomeValue'); // 0.0.1+1
expect(repo.runAction()).toMatch('Version is 0.1.0+0');
repo.clean();
});
test('Short tags disabled matches full tags', () => {
const repo = createTestRepo({ short_tags: 'false' }); // 0.0.0
repo.makeCommit('Initial Commit');
repo.makeCommit('Second Commit');
repo.makeCommit('Third Commit');
repo.exec('git tag v1.2.3');
const result = repo.runAction();
expect(result).toMatch('Version is 1.2.3+0');
repo.clean();
});
test('Tag prefix can include forward slash', () => {
const repo = createTestRepo({ short_tags: 'false', tag_prefix: 'version/' }); // 0.0.0
repo.makeCommit('Initial Commit');
repo.exec('git tag version/1.2.3');
const result = repo.runAction();
expect(result).toMatch('Version is 1.2.3+0');
repo.clean();
});
test('[Use Branch Names] Commit messages do not affect version', () => {
const repo = createTestRepo({ tag_prefix: '', use_test_value: true, test_value: 'some_patch', major_pattern: "major/", minor_pattern: "minor/"}); // 0.0.0
repo.makeCommit('Initial Commit');
repo.exec('git tag 1.2.3');
repo.makeCommit('First commit on patch branch');
expect(repo.runAction()).toMatch('Version is 1.2.4+0');
const repo2 = createTestRepo({ tag_prefix: '', use_test_value: true, test_value: 'major/banger', major_pattern: "major/", minor_pattern: "minor/"}); // 0.0.0
repo2.makeCommit('Initial Commit');
repo2.exec('git tag 1.2.3');
repo2.makeCommit('First commit on major branch');
expect(repo2.runAction()).toMatch('Version is 2.0.0+0');
const repo3 = createTestRepo({ tag_prefix: '', use_test_value: true, test_value: 'minor/problem', major_pattern: "major/", minor_pattern: "minor/"}); // 0.0.0
repo3.makeCommit('Initial Commit');
repo3.exec('git tag 1.2.3');
repo3.makeCommit('First commit on minor branch');
expect(repo3.runAction()).toMatch('Version is 1.3.0+0');
repo.clean();
repo2.clean();
repo3.clean();
});
test('[Use Branch Names] regex works as expected', () => {
const repo = createTestRepo({ tag_prefix: '', use_test_value: true, test_value: 'some_patch', major_pattern: "/^(major|breaking)/", minor_pattern: "/^(minor|feature|feat)//"}); // 0.0.0
repo.makeCommit('Initial Commit');
repo.exec('git tag 1.2.3');
repo.makeCommit('First commit on patch branch');
expect(repo.runAction()).toMatch('Version is 1.2.4+0');
const repo2 = createTestRepo({ tag_prefix: '', use_test_value: true, test_value: 'major/banger', major_pattern: "/^(major|breaking)/", minor_pattern: "/^(minor|feature|feat)//"}); // 0.0.0
repo2.makeCommit('Initial Commit');
repo2.exec('git tag 1.2.3');
repo2.makeCommit('First commit on major branch');
expect(repo2.runAction()).toMatch('Version is 2.0.0+0');
const repo3 = createTestRepo({ tag_prefix: '', use_test_value: true, test_value: 'minor/problem', major_pattern: "/^(major|breaking)/", minor_pattern: "/^(minor|feature|feat)//"}); // 0.0.0
repo3.makeCommit('Initial Commit');
repo3.exec('git tag 1.2.3');
repo3.makeCommit('First commit on minor branch');
expect(repo3.runAction()).toMatch('Version is 1.3.0+0');
const repo4 = createTestRepo({ tag_prefix: '', use_test_value: true, test_value: 'breaking/banger', major_pattern: "/^(major|breaking)/", minor_pattern: "/^(minor|feature|feat)//"}); // 0.0.0
repo4.makeCommit('Initial Commit');
repo4.exec('git tag 1.2.3');
repo4.makeCommit('First commit on major branch');
expect(repo4.runAction()).toMatch('Version is 2.0.0+0');
const repo5 = createTestRepo({ tag_prefix: '', use_test_value: true, test_value: 'feature/problem', major_pattern: "/^(major|breaking)/", minor_pattern: "/^(minor|feature|feat)//"}); // 0.0.0
repo5.makeCommit('Initial Commit');
repo5.exec('git tag 1.2.3');
repo5.makeCommit('First commit on minor branch');
expect(repo5.runAction()).toMatch('Version is 1.3.0+0');
const repo6 = createTestRepo({ tag_prefix: '', use_test_value: true, test_value: 'feat/problem', major_pattern: "/^(major|breaking)/", minor_pattern: "/^(minor|feature|feat)//"}); // 0.0.0
repo6.makeCommit('Initial Commit');
repo6.exec('git tag 1.2.3');
repo6.makeCommit('First commit on minor branch');
expect(repo6.runAction()).toMatch('Version is 1.3.0+0');
const repo7 = createTestRepo({ tag_prefix: '', use_test_value: true, test_value: 'team/feat/bar', major_pattern: "/^(major|breaking)/", minor_pattern: "/^(minor|feature|feat)//"}); // 0.0.0
repo7.makeCommit('Initial Commit');
repo7.exec('git tag 1.2.3');
repo7.makeCommit('First commit on patch branch');
expect(repo7.runAction()).toMatch('Version is 1.2.4+0');
repo.clean();
repo2.clean();
repo3.clean();
repo4.clean();
repo5.clean();
repo6.clean();
repo7.clean();
});