File tree Expand file tree Collapse file tree 3 files changed +26
-4
lines changed Expand file tree Collapse file tree 3 files changed +26
-4
lines changed Original file line number Diff line number Diff line change 39
39
"import" : " ./dist/index.js"
40
40
}
41
41
},
42
- "files" : [" dist/**" ],
42
+ "files" : [
43
+ " dist/**"
44
+ ],
43
45
"repository" : " tinylibs/tinybench" ,
44
46
"license" : " MIT" ,
45
47
"devDependencies" : {
65
67
"typescript" : " ~5.6.3" ,
66
68
"vitest" : " ^2.1.5"
67
69
},
68
- "keywords" : [" benchmark" , " tinylibs" , " tiny" ]
70
+ "keywords" : [
71
+ " benchmark" ,
72
+ " tinylibs" ,
73
+ " tiny"
74
+ ]
69
75
}
Original file line number Diff line number Diff line change @@ -233,8 +233,6 @@ export class Bench extends EventTarget {
233
233
Error : task . result . error . message ,
234
234
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
235
235
Stack : task . result . error . stack ! ,
236
- // eslint-disable-next-line perfectionist/sort-objects
237
- Samples : task . result . latency . samples . length ,
238
236
}
239
237
: ( convert ?.( task ) ?? {
240
238
'Task name' : task . name ,
Original file line number Diff line number Diff line change @@ -64,6 +64,24 @@ test('bench table', async () => {
64
64
Samples : expect . any ( Number ) ,
65
65
} ,
66
66
] )
67
+
68
+ bench . remove ( 'foo' )
69
+ bench . add ( 'bar' , ( ) => {
70
+ throw new Error ( 'fake' )
71
+ } )
72
+
73
+ await bench . run ( )
74
+
75
+ expect ( bench . table ( ) ) . toStrictEqual ( [
76
+ {
77
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
78
+ 'Task name' : expect . any ( String ) ,
79
+ // eslint-disable-next-line perfectionist/sort-objects, @typescript-eslint/no-unsafe-assignment
80
+ Error : expect . any ( String ) ,
81
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
82
+ Stack : expect . any ( String ) ,
83
+ } ,
84
+ ] )
67
85
} )
68
86
69
87
test ( 'bench task runs and time consistency' , async ( ) => {
You can’t perform that action at this time.
0 commit comments