1
- import { MockedFunction , describe , expect , it , vi } from "vitest" ;
1
+ import { describe , expect , it , type MockedFunction , vi } from "vitest" ;
2
+
2
3
import {
3
- generateDocumentation , getUnversionedDocumentationFilePath , getVersionedDocumentationFilePath ,
4
- } from "../generateDocs" ;
5
- import { generateAllContractInformation } from "../helpers/generateAllContractInformation" ;
6
- import { writeDocumentation } from "../helpers/writeDocumentation" ;
4
+ generateDocumentation ,
5
+ getUnversionedDocumentationFilePath ,
6
+ getVersionedDocumentationFilePath ,
7
+ } from "../generateDocs.js" ;
8
+ import { generateAllContractInformation } from "../helpers/generateAllContractInformation.js" ;
9
+ import { writeDocumentation } from "../helpers/writeDocumentation.js" ;
7
10
8
11
describe ( "Given a generate docs script" , ( ) => {
9
12
describe ( "With function getUnversionedDocumentationFilePath to generate filepaths" , ( ) => {
10
- it ( "Returns a filepath based on its input" , async ( ) => {
13
+ it ( "Returns a filepath based on its input" , ( ) => {
11
14
expect (
12
15
getUnversionedDocumentationFilePath (
13
16
"mockPathToDocumentationFolder" ,
14
- "mockDetailType"
15
- )
17
+ "mockDetailType" ,
18
+ ) ,
16
19
) . toStrictEqual ( "mockPathToDocumentationFolder/mockDetailType" ) ;
17
20
} ) ;
18
21
} ) ;
19
22
20
23
describe ( "With function getVersionedDocumentationFilePath to generate filepaths" , ( ) => {
21
- it ( "Returns a filepath based on input" , async ( ) => {
24
+ it ( "Returns a filepath based on input" , ( ) => {
22
25
expect (
23
26
getVersionedDocumentationFilePath (
24
27
"mockPathToDocumentationFolder" ,
25
28
"mockDetailType" ,
26
- 100
27
- )
29
+ 100 ,
30
+ ) ,
28
31
) . toStrictEqual (
29
- "mockPathToDocumentationFolder/mockDetailType/versioned/100"
32
+ "mockPathToDocumentationFolder/mockDetailType/versioned/100" ,
30
33
) ;
31
34
} ) ;
32
35
} ) ;
@@ -68,11 +71,11 @@ describe("Given a generate docs script", () => {
68
71
} ) ;
69
72
await generateDocumentation (
70
73
"mockPathToContractsFolder" ,
71
- "mockPathToDocumentationFolder"
74
+ "mockPathToDocumentationFolder" ,
72
75
) ;
73
76
expect ( mockWriteDocumentation ) . toBeCalledWith (
74
77
mockSchemaDetails ,
75
- `mockPathToDocumentationFolder/mockDetailTypeConst/versioned/10`
78
+ `mockPathToDocumentationFolder/mockDetailTypeConst/versioned/10` ,
76
79
) ;
77
80
} ) ;
78
81
@@ -83,11 +86,11 @@ describe("Given a generate docs script", () => {
83
86
} ) ;
84
87
await generateDocumentation (
85
88
"mockPathToContractsFolder" ,
86
- "mockPathToDocumentationFolder"
89
+ "mockPathToDocumentationFolder" ,
87
90
) ;
88
91
expect ( mockWriteDocumentation ) . toBeCalledWith (
89
92
mockSchemaDetails ,
90
- `mockPathToDocumentationFolder/mockDetailTypeConst`
93
+ `mockPathToDocumentationFolder/mockDetailTypeConst` ,
91
94
) ;
92
95
} ) ;
93
96
} ) ;
0 commit comments