0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-13 22:11:20 -05:00

Allow writable in the tests

This commit is contained in:
Matthew Phillips 2024-02-15 15:41:36 -05:00
parent c6183140f2
commit 61000fc28e

View file

@ -54,14 +54,14 @@ export async function seedData({
try {
await data({
seed: async ({ table, writable }, values) => {
if (writable && mode === 'build') {
if (writable && mode === 'build' && process.env.ASTRO_DB_TEST_ENV !== '1') {
(logger ?? console).error(SEED_WRITABLE_IN_PROD_ERROR(getTableName(table)));
process.exit(1);
}
await db.insert(table).values(values as any);
},
seedReturning: async ({ table, writable }, values) => {
if (writable && mode === 'build') {
if (writable && mode === 'build' && process.env.ASTRO_DB_TEST_ENV !== '1') {
(logger ?? console).error(SEED_WRITABLE_IN_PROD_ERROR(getTableName(table)));
process.exit(1);
}