Skip to content

Commit

Permalink
chore: so close, but yet so far #407
Browse files Browse the repository at this point in the history
  • Loading branch information
bsilkyn committed May 22, 2024
1 parent d78c60d commit 430c86e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
15 changes: 8 additions & 7 deletions frontend/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import path from 'path';
import { defineConfig } from 'cypress';
import vitePreprocessor from 'cypress-vite';

import { seed } from '@/test/e2e/setup/seed.ts';
const preprocessor = vitePreprocessor('./vite.config.ts');

export default defineConfig({
e2e: {
Expand All @@ -11,15 +11,16 @@ export default defineConfig({
vitePreprocessor('./vite.config.ts')
);
on('before:run',
async (_) => {
await seed();
() => {
preprocessor();
import('@/test/e2e/setup/seed.ts').then(async (module) => {
await module.seed();
});
}
);
// on('task', {
// async 'db:seed'() {
// // import { seed } from '@/test/e2e/setup/seed.ts';
// // import { client } from '@/config/axios.ts';
// await seed(client);
// async 'db:seed'(seed) {
// await seed();
// }
// });
},
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/test/e2e/setup/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ import '../../../../cypress/support/commands.ts'

import { seed } from '@/test/e2e/setup/seed.ts';

seed().then(r => console.log(r));
it('fills database', () => {
cy.task('db:seed', seed);
})

0 comments on commit 430c86e

Please sign in to comment.