chore(web): migrate to vitest (#5754)

* Updated vite and ts config file with vtest options and a new alias to fix the dev command error

* Updated package script and update the packages
 -- this removes jest dependencies

* Added new setup file needed in vitest in order to be able to use the jest-dom matchers in tests

* Updated deprecated utilities when using faker

* Updated test files and mocks to use vitest instead of jest

* Enabled web test check in GitHub actions

* remove babel dependencies as they are no longer needed with vitest

* move the jest config files to a folder in case we need to go back to jest

* chore: remove old files

---------

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
Jorge Avila 2024-01-01 10:36:49 -07:00 committed by GitHub
parent 9de557916b
commit 5f6d09d3da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 2227 additions and 6080 deletions

View file

@ -11,8 +11,8 @@ export const albumFactory = Sync.makeFactory<AlbumResponseDto>({
assets: [],
createdAt: Sync.each(() => faker.date.past().toISOString()),
updatedAt: Sync.each(() => faker.date.past().toISOString()),
id: Sync.each(() => faker.datatype.uuid()),
ownerId: Sync.each(() => faker.datatype.uuid()),
id: Sync.each(() => faker.string.uuid()),
ownerId: Sync.each(() => faker.string.uuid()),
owner: userFactory.build(),
shared: false,
sharedUsers: [],

View file

@ -3,11 +3,11 @@ import { faker } from '@faker-js/faker';
import { Sync } from 'factory.ts';
export const userFactory = Sync.makeFactory<UserResponseDto>({
id: Sync.each(() => faker.datatype.uuid()),
id: Sync.each(() => faker.string.uuid()),
email: Sync.each(() => faker.internet.email()),
name: Sync.each(() => faker.name.fullName()),
storageLabel: Sync.each(() => faker.random.alphaNumeric()),
externalPath: Sync.each(() => faker.random.alphaNumeric()),
name: Sync.each(() => faker.person.fullName()),
storageLabel: Sync.each(() => faker.string.alphanumeric()),
externalPath: Sync.each(() => faker.string.alphanumeric()),
profileImagePath: '',
shouldChangePassword: Sync.each(() => faker.datatype.boolean()),
isAdmin: true,

View file

@ -0,0 +1 @@
import '@testing-library/jest-dom';