1
- import { bench , describe } from " vitest" ;
1
+ import { bench , describe } from ' vitest' ;
2
2
3
3
import { parse } from '../language/parser.js' ;
4
4
@@ -17,6 +17,7 @@ function syncListField() {
17
17
return results ;
18
18
}
19
19
20
+ // eslint-disable-next-line @typescript-eslint/require-await
20
21
async function asyncListField ( ) {
21
22
const results = [ ] ;
22
23
for ( let index = 0 ; index < 1000 ; index ++ ) {
@@ -25,22 +26,23 @@ async function asyncListField() {
25
26
return results ;
26
27
}
27
28
29
+ // eslint-disable-next-line @typescript-eslint/require-await
28
30
async function * asyncIterableListField ( ) {
29
31
for ( let index = 0 ; index < 1000 ; index ++ ) {
30
32
yield index ;
31
33
}
32
34
}
33
35
34
- describe ( " execute listField benchmarks" , ( ) => {
35
- bench ( " Execute Synchronous List Field" , async ( ) => {
36
+ describe ( ' execute listField benchmarks' , ( ) => {
37
+ bench ( ' Execute Synchronous List Field' , async ( ) => {
36
38
await execute ( { schema, document, rootValue : { listField : syncListField } } ) ;
37
39
} ) ;
38
40
39
- bench ( " Execute Asynchronous List Field" , async ( ) => {
41
+ bench ( ' Execute Asynchronous List Field' , async ( ) => {
40
42
await execute ( { schema, document, rootValue : { listField : asyncListField } } ) ;
41
43
} ) ;
42
44
43
- bench ( " Execute Async Iterable List Field" , async ( ) => {
45
+ bench ( ' Execute Async Iterable List Field' , async ( ) => {
44
46
await execute ( { schema, document, rootValue : { listField : asyncIterableListField } } ) ;
45
47
} ) ;
46
48
} ) ;
0 commit comments