@@ -56,6 +56,22 @@ test('returns a crate object for known crates', async function () {
5656 downloads : 3702 ,
5757 features : { } ,
5858 license : 'MIT' ,
59+ linecounts : {
60+ languages : {
61+ JavaScript : {
62+ code_lines : 325 ,
63+ comment_lines : 80 ,
64+ files : 8 ,
65+ } ,
66+ TypeScript : {
67+ code_lines : 195 ,
68+ comment_lines : 10 ,
69+ files : 2 ,
70+ } ,
71+ } ,
72+ total_code_lines : 520 ,
73+ total_comment_lines : 90 ,
74+ } ,
5975 links : {
6076 dependencies : '/api/v1/crates/rand/1.0.0-beta.1/dependencies' ,
6177 version_downloads : '/api/v1/crates/rand/1.0.0-beta.1/downloads' ,
@@ -121,6 +137,22 @@ test('works for non-canonical names', async function () {
121137 downloads : 3702 ,
122138 features : { } ,
123139 license : 'MIT' ,
140+ linecounts : {
141+ languages : {
142+ JavaScript : {
143+ code_lines : 325 ,
144+ comment_lines : 80 ,
145+ files : 8 ,
146+ } ,
147+ TypeScript : {
148+ code_lines : 195 ,
149+ comment_lines : 10 ,
150+ files : 2 ,
151+ } ,
152+ } ,
153+ total_code_lines : 520 ,
154+ total_comment_lines : 90 ,
155+ } ,
124156 links : {
125157 dependencies : '/api/v1/crates/foo-bar/1.0.0-beta.1/dependencies' ,
126158 version_downloads : '/api/v1/crates/foo-bar/1.0.0-beta.1/downloads' ,
@@ -159,6 +191,17 @@ test('includes related versions', async function () {
159191 downloads : 11_106 ,
160192 features : { } ,
161193 license : 'MIT/Apache-2.0' ,
194+ linecounts : {
195+ languages : {
196+ Python : {
197+ code_lines : 421 ,
198+ comment_lines : 64 ,
199+ files : 8 ,
200+ } ,
201+ } ,
202+ total_code_lines : 421 ,
203+ total_comment_lines : 64 ,
204+ } ,
162205 links : {
163206 dependencies : '/api/v1/crates/rand/1.2.0/dependencies' ,
164207 version_downloads : '/api/v1/crates/rand/1.2.0/downloads' ,
@@ -181,6 +224,27 @@ test('includes related versions', async function () {
181224 downloads : 7404 ,
182225 features : { } ,
183226 license : 'Apache-2.0' ,
227+ linecounts : {
228+ languages : {
229+ CSS : {
230+ code_lines : 503 ,
231+ comment_lines : 42 ,
232+ files : 2 ,
233+ } ,
234+ Python : {
235+ code_lines : 284 ,
236+ comment_lines : 91 ,
237+ files : 3 ,
238+ } ,
239+ TypeScript : {
240+ code_lines : 332 ,
241+ comment_lines : 83 ,
242+ files : 7 ,
243+ } ,
244+ } ,
245+ total_code_lines : 1119 ,
246+ total_comment_lines : 216 ,
247+ } ,
184248 links : {
185249 dependencies : '/api/v1/crates/rand/1.1.0/dependencies' ,
186250 version_downloads : '/api/v1/crates/rand/1.1.0/downloads' ,
@@ -203,6 +267,22 @@ test('includes related versions', async function () {
203267 downloads : 3702 ,
204268 features : { } ,
205269 license : 'MIT' ,
270+ linecounts : {
271+ languages : {
272+ JavaScript : {
273+ code_lines : 325 ,
274+ comment_lines : 80 ,
275+ files : 8 ,
276+ } ,
277+ TypeScript : {
278+ code_lines : 195 ,
279+ comment_lines : 10 ,
280+ files : 2 ,
281+ } ,
282+ } ,
283+ total_code_lines : 520 ,
284+ total_comment_lines : 90 ,
285+ } ,
206286 links : {
207287 dependencies : '/api/v1/crates/rand/1.0.0/dependencies' ,
208288 version_downloads : '/api/v1/crates/rand/1.0.0/downloads' ,
0 commit comments