-
-
Couldn't load subscription status.
- Fork 0
Open
Description
Extend our existing benchmarkSuite API to support factory functions in 2 places as an alternative to module-scoped variables and to support a variable scope for each benchmark function and its hooks.
benchmarkSuiteshould support a factory as second parameter
benchmarkSuite('Suite', () => {
// Shared scope for all benchmarks
let projectDirectory: string;
return {
benchmarks: {
'Test': {
fn: () => { /* uses projectDirectory */ },
beforeAll: () => { projectDirectory = createProject(); }
}
},
setupSuite: () => { /* setup */ },
teardownSuite: () => { /* can access projectDirectory */ }
};
});- Each
benchmarksvalue should accept a factory function
benchmarkSuite('Suite',
{ // bencmarks
'Test': () => {
let projectDirectory: string;
return {
fn: () => { /* uses projectDirectory */ },
beforeAll: () => { projectDirectory = createProject(); }
}
};
}
};
});But also:
benchmarkSuite('Suite',
{ // bencmarks
'Test': () => {
let projectDirectory: string;
return () => { /* uses projectDirectory */ };
};
}
};
});Copilot
Metadata
Metadata
Assignees
Labels
No labels