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 3939 "import" : " ./dist/index.js"
4040 }
4141 },
42- "files" : [" dist/**" ],
42+ "files" : [
43+ " dist/**"
44+ ],
4345 "repository" : " tinylibs/tinybench" ,
4446 "license" : " MIT" ,
4547 "devDependencies" : {
6567 "typescript" : " ~5.6.3" ,
6668 "vitest" : " ^2.1.5"
6769 },
68- "keywords" : [" benchmark" , " tinylibs" , " tiny" ]
70+ "keywords" : [
71+ " benchmark" ,
72+ " tinylibs" ,
73+ " tiny"
74+ ]
6975}
Original file line number Diff line number Diff line change @@ -233,8 +233,6 @@ export class Bench extends EventTarget {
233233 Error : task . result . error . message ,
234234 // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
235235 Stack : task . result . error . stack ! ,
236- // eslint-disable-next-line perfectionist/sort-objects
237- Samples : task . result . latency . samples . length ,
238236 }
239237 : ( convert ?.( task ) ?? {
240238 'Task name' : task . name ,
Original file line number Diff line number Diff line change @@ -64,6 +64,24 @@ test('bench table', async () => {
6464 Samples : expect . any ( Number ) ,
6565 } ,
6666 ] )
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+ ] )
6785} )
6886
6987test ( 'bench task runs and time consistency' , async ( ) => {
You can’t perform that action at this time.
0 commit comments