Skip to content

Commit 1a301a2

Browse files
[autofix.ci] apply automated fixes
1 parent aaeed30 commit 1a301a2

File tree

1 file changed

+38
-30
lines changed

1 file changed

+38
-30
lines changed

test/nuxt/composables/use-repository-url.spec.ts

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,40 @@ import { describe, expect, it } from 'vitest'
1111
*/
1212
describe('useRepositoryUrl', () => {
1313
it('should strip .git from repository URL', () => {
14-
const { repositoryUrl } = useRepositoryUrl(ref({
15-
repository: {
16-
type: 'git',
17-
url: 'git+https://github.com/agentmarkup/agentmarkup.git',
18-
},
19-
}))
14+
const { repositoryUrl } = useRepositoryUrl(
15+
ref({
16+
repository: {
17+
type: 'git',
18+
url: 'git+https://github.com/agentmarkup/agentmarkup.git',
19+
},
20+
}),
21+
)
2022

2123
expect(repositoryUrl.value).toBe('https://github.com/agentmarkup/agentmarkup')
2224
})
2325

2426
it('should append /tree/HEAD/{directory} for monorepo packages without .git', () => {
25-
const { repositoryUrl } = useRepositoryUrl(ref({
26-
repository: {
27-
type: 'git',
28-
url: 'git+https://github.com/agentmarkup/agentmarkup.git',
29-
directory: 'packages/vite',
30-
},
31-
}))
27+
const { repositoryUrl } = useRepositoryUrl(
28+
ref({
29+
repository: {
30+
type: 'git',
31+
url: 'git+https://github.com/agentmarkup/agentmarkup.git',
32+
directory: 'packages/vite',
33+
},
34+
}),
35+
)
3236

3337
expect(repositoryUrl.value).toBe(
3438
'https://github.com/agentmarkup/agentmarkup/tree/HEAD/packages/vite',
3539
)
3640
})
3741

3842
it('should return null when repository has no url', () => {
39-
const { repositoryUrl } = useRepositoryUrl(ref({
40-
repository: {},
41-
}))
43+
const { repositoryUrl } = useRepositoryUrl(
44+
ref({
45+
repository: {},
46+
}),
47+
)
4248

4349
expect(repositoryUrl.value).toBeNull()
4450
})
@@ -50,25 +56,27 @@ describe('useRepositoryUrl', () => {
5056
})
5157

5258
it('should handle plain HTTPS URLs without .git suffix', () => {
53-
const { repositoryUrl } = useRepositoryUrl(ref({
54-
repository: {
55-
url: 'https://github.com/nuxt/ui',
56-
},
57-
}))
59+
const { repositoryUrl } = useRepositoryUrl(
60+
ref({
61+
repository: {
62+
url: 'https://github.com/nuxt/ui',
63+
},
64+
}),
65+
)
5866

5967
expect(repositoryUrl.value).toBe('https://github.com/nuxt/ui')
6068
})
6169

6270
it('should handle directory with trailing slash', () => {
63-
const { repositoryUrl } = useRepositoryUrl(ref({
64-
repository: {
65-
url: 'git+https://github.com/org/repo.git',
66-
directory: 'packages/core/',
67-
},
68-
}))
69-
70-
expect(repositoryUrl.value).toBe(
71-
'https://github.com/org/repo/tree/HEAD/packages/core/',
71+
const { repositoryUrl } = useRepositoryUrl(
72+
ref({
73+
repository: {
74+
url: 'git+https://github.com/org/repo.git',
75+
directory: 'packages/core/',
76+
},
77+
}),
7278
)
79+
80+
expect(repositoryUrl.value).toBe('https://github.com/org/repo/tree/HEAD/packages/core/')
7381
})
7482
})

0 commit comments

Comments
 (0)