File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99jobs :
1010 backend-tests :
1111 runs-on : ubuntu-latest
12+ services :
13+ mongodb :
14+ image : mongo:latest
15+ ports :
16+ - 27017:27017
1217 steps :
1318 - uses : actions/checkout@v4
1419 - name : Setup Node.js
2631 env :
2732 NODE_ENV : test
2833 RESEND_API_KEY : ${{ secrets.RESEND_API_KEY }}
29- TEST_MONGO_URL : ${{ secrets.MONGO_URL_TEST }}
34+ TEST_MONGO_URL : mongodb://localhost:27017/test_db
3035 JWT_SECRET : ${{ secrets.JWT_SECRET }}
3136 SUPABASE_URL : " https://dummy.supabase.co"
3237 SUPABASE_KEY : " dummy-key"
Original file line number Diff line number Diff line change @@ -20,10 +20,14 @@ require('dotenv').config();
2020
2121// --- SETUP
2222beforeAll ( async ( ) => {
23- // Connect to the TEST Database
2423 const uri = process . env . TEST_MONGO_URL ;
25- if ( ! uri ) {
26- throw new Error ( "TEST_MONGO_URL not defined in .env" ) ;
24+
25+ // Debugging (Secret is masked as *** in GitHub logs, but we can check the format)
26+ console . log ( "URI Length:" , uri ? uri . length : 0 ) ;
27+ console . log ( "URI Starts with mongodb:" , uri ? uri . startsWith ( 'mongodb' ) : false ) ;
28+
29+ if ( ! uri || ! uri . startsWith ( 'mongodb' ) ) {
30+ throw new Error ( `Invalid TEST_MONGO_URL! Received: ${ uri ? 'invalid format' : 'nothing' } ` ) ;
2731 }
2832
2933 await mongoose . disconnect ( ) ;
You can’t perform that action at this time.
0 commit comments