polen 0.10.0-next.7 → 0.10.0-next.9
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.
package/package.json
CHANGED
@@ -3,6 +3,11 @@ import type { SimpleGit } from 'simple-git'
|
|
3
3
|
import { beforeEach, describe, expect, it, type Mock, vi } from 'vitest'
|
4
4
|
import { VersionHistory } from './index.ts'
|
5
5
|
|
6
|
+
// Mock the simple-git module
|
7
|
+
vi.mock('simple-git', () => ({
|
8
|
+
simpleGit: vi.fn(),
|
9
|
+
}))
|
10
|
+
|
6
11
|
describe('VersionHistory', () => {
|
7
12
|
describe('parseSemver', () => {
|
8
13
|
it('parses standard semver tags', () => {
|
@@ -99,16 +104,19 @@ describe('VersionHistory', () => {
|
|
99
104
|
tag: Mock
|
100
105
|
}
|
101
106
|
|
102
|
-
beforeEach(() => {
|
107
|
+
beforeEach(async () => {
|
108
|
+
vi.clearAllMocks()
|
109
|
+
|
103
110
|
mockGit = {
|
104
111
|
tags: vi.fn(),
|
105
112
|
show: vi.fn(),
|
106
113
|
revparse: vi.fn(),
|
107
114
|
tag: vi.fn(),
|
108
115
|
}
|
109
|
-
|
110
|
-
//
|
111
|
-
|
116
|
+
|
117
|
+
// Mock the simpleGit function to return our mock git instance
|
118
|
+
const { simpleGit } = await import('simple-git')
|
119
|
+
vi.mocked(simpleGit).mockReturnValue(mockGit as unknown as SimpleGit)
|
112
120
|
})
|
113
121
|
|
114
122
|
it('returns latest stable and newer prereleases', async () => {
|