Skip to content

Commit

Permalink
Update builder.test.mjs
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot committed Oct 17, 2024
1 parent b6ab66d commit 7682b52
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions packages/mui-icons-material/builder.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,27 @@ describe('builder', () => {
};

// eslint-disable-next-line mocha/handle-done-callback
beforeEach(async function beforeEachHook(ctx) {
// DON'T CLEAN UP TO MAKE TEST INSPECTABLE
options.outputDir = path.join(
os.tmpdir(),
'material-ui-icons-builder-test',
process.env.VITEST ? ctx.task.name : this.currentTest.fullTitle(),
);
await fse.emptyDir(options.outputDir);
});
beforeEach(
process.env.VITEST
? async function beforeEachHook(ctx) {
// DON'T CLEAN UP TO MAKE TEST INSPECTABLE
options.outputDir = path.join(
os.tmpdir(),
'material-ui-icons-builder-test',
ctx.task.name,
);
await fse.emptyDir(options.outputDir);
}
: async function beforeEachHook() {
// DON'T CLEAN UP TO MAKE TEST INSPECTABLE
options.outputDir = path.join(
os.tmpdir(),
'material-ui-icons-builder-test',
this.currentTest.fullTitle(),
);
await fse.emptyDir(options.outputDir);
},
);

it('script outputs to directory', async () => {
await handler(options);
Expand Down

0 comments on commit 7682b52

Please sign in to comment.