File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { describe , expect , it } from 'vitest'
2+
3+ const fakeRequestedVersion = (
4+ data : Partial < SlimPackument [ 'requestedVersion' ] > ,
5+ ) : SlimPackument [ 'requestedVersion' ] => {
6+ return {
7+ _id : 'any' ,
8+ _npmVersion : 'idk' ,
9+ dist : {
10+ shasum : '' ,
11+ signatures : [ ] ,
12+ tarball : '' ,
13+ } ,
14+ name : 'any' ,
15+ version : '0.0.1' ,
16+ ...data ,
17+ }
18+ }
19+
20+ describe ( 'useRepositoryUrl' , ( ) => {
21+ it ( 'should have valid github repository url' , ( ) => {
22+ const test = fakeRequestedVersion ( {
23+ repository : {
24+ type : 'git' ,
25+ url : 'git+https://github.com/nuxt/nuxt.git' ,
26+ directory : 'packages/nuxt' ,
27+ } ,
28+ } )
29+
30+ const result = useRepositoryUrl ( test )
31+
32+ expect ( result . repositoryUrl . value ) . toEqual (
33+ 'https://github.com/nuxt/nuxt/tree/HEAD/packages/nuxt' ,
34+ )
35+ } )
36+ } )
You can’t perform that action at this time.
0 commit comments