Files
Compass/tests/e2e/utils/userCreation.ts
Martin Braquet ba9b3cfb06 Add pretty formatting (#29)
* Test

* Add pretty formatting

* Fix Tests

* Fix Tests

* Fix Tests

* Fix

* Add pretty formatting fix

* Fix

* Test

* Fix tests

* Clean typeckech

* Add prettier check

* Fix api tsconfig

* Fix api tsconfig

* Fix tsconfig

* Fix

* Fix

* Prettier
2026-02-20 17:32:27 +01:00

32 lines
993 B
TypeScript

//Run with:
// export ENVIRONMENT=DEV && npx tsx userCreation.ts
import {createSupabaseDirectClient} from 'shared/supabase/init'
import UserAccountInformation from '../backend/utils/userInformation'
import {seedDatabase} from './seedDatabase'
type ProfileType = 'basic' | 'medium' | 'full'
;(async () => {
const pg = createSupabaseDirectClient()
//Edit the count seedConfig to specify the amount of each profiles to create
const seedConfig = [
{count: 1, profileType: 'basic' as ProfileType},
{count: 1, profileType: 'medium' as ProfileType},
{count: 1, profileType: 'full' as ProfileType},
]
for (const {count, profileType} of seedConfig) {
for (let i = 0; i < count; i++) {
const userInfo = new UserAccountInformation()
if (i == 0) {
// Seed the first profile with deterministic data for the e2e tests
userInfo.name = 'Franklin Buckridge'
}
await seedDatabase(pg, userInfo, profileType)
}
}
process.exit(0)
})()