chore: save WIP before workstation switch
This commit is contained in:
@@ -14,22 +14,17 @@ setDefaultTimeout(30000);
|
||||
// Global browser instance
|
||||
let browser: Browser;
|
||||
|
||||
// Load environment files
|
||||
const envPath = path.resolve(process.cwd(), '.env');
|
||||
// Load environment file (gitignored, contains dev database URL)
|
||||
const envDevPath = path.resolve(process.cwd(), '.env.development');
|
||||
|
||||
if (fs.existsSync(envPath)) {
|
||||
require('dotenv').config({ path: envPath });
|
||||
}
|
||||
|
||||
if (fs.existsSync(envDevPath)) {
|
||||
require('dotenv').config({ path: envDevPath, override: true });
|
||||
require('dotenv').config({ path: envDevPath });
|
||||
}
|
||||
|
||||
// Database safety check - prevent tests from running against production
|
||||
function isProductionDatabase(): boolean {
|
||||
const dbUrl = process.env.DATABASE_URL || '';
|
||||
return dbUrl.includes('euchre_camp') && !dbUrl.includes('_dev') && !dbUrl.includes('test');
|
||||
return dbUrl.includes('euchre_camp') && !dbUrl.includes('_dev') && !dbUrl.includes('_ci') && !dbUrl.includes('test');
|
||||
}
|
||||
|
||||
if (isProductionDatabase()) {
|
||||
@@ -135,7 +130,8 @@ After(async function () {
|
||||
where: {
|
||||
OR: [
|
||||
{ name: { startsWith: 'Test Tournament' } },
|
||||
{ name: { startsWith: 'Test Schedule Tournament' } }
|
||||
{ name: { startsWith: 'Test Schedule Tournament' } },
|
||||
{ name: { startsWith: 'Recent Tournament' } },
|
||||
]
|
||||
},
|
||||
select: { id: true }
|
||||
@@ -176,7 +172,9 @@ After(async function () {
|
||||
{ name: { startsWith: 'Tournament Player' } },
|
||||
{ name: { startsWith: 'Schedule Player' } },
|
||||
{ name: { startsWith: 'Test Player' } },
|
||||
{ name: { startsWith: 'Test Activity Player' } }
|
||||
{ name: { startsWith: 'Test Activity Player' } },
|
||||
{ name: { startsWith: 'Home Test Player' } },
|
||||
{ name: { startsWith: 'HP' } },
|
||||
]
|
||||
}
|
||||
});
|
||||
@@ -184,7 +182,10 @@ After(async function () {
|
||||
// Delete test users
|
||||
await prisma.user.deleteMany({
|
||||
where: {
|
||||
email: { startsWith: 'cucumber-' }
|
||||
OR: [
|
||||
{ email: { startsWith: 'cucumber-' } },
|
||||
{ email: { startsWith: 'president-' } },
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user