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:
parent
c6183140f2
commit
61000fc28e
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue