Skip to content

Commit

Permalink
test: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
fabienwnklr committed Jan 18, 2024
1 parent c13443c commit 32ffcad
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/ui.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('Ui', () => {
// drawer.ctx.
const path = new Path2D('M 100,100 h 50 v 50 h 50');
drawer.ctx.stroke(path);
sleep(100).then(() => {
sleep(500).then(() => {
drawer.toolbar.$clearBtn?.dispatchEvent(new Event('click'));
expect(drawer.clearModal).toBeInstanceOf(ConfirmModal);
expect(drawer.clearModal.isVisible()).toBe(true);
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ describe('utilities', () => {

const end = Date.now();
const timer = end - start;
expect(timer).toBeGreaterThan(100);
expect(timer).toBeGreaterThanOrEqual(100);
});
});
10 changes: 6 additions & 4 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ export default defineConfig({
{
name: 'postbuild-commands', // the name of your custom plugin. Could be anything.
closeBundle: async () => {
console.log('Build docs...');
execSync('npm run build:docs'); // run during closeBundle hook. https://rollupjs.org/guide/en/#closebundle
console.log('Docs build !');
if (process.env.NODE_ENV !== 'test') {
console.log('Build docs...');
execSync('npm run build:docs'); // run during closeBundle hook. https://rollupjs.org/guide/en/#closebundle
console.log('Docs build !');
}
},
},
],
Expand All @@ -44,7 +46,7 @@ export default defineConfig({
},
},
server: {
open: process.env.NODE_ENV === 'test',
open: process.env.NODE_ENV !== 'test',
},
test: {
server: {
Expand Down

0 comments on commit 32ffcad

Please sign in to comment.