diff --git a/.github/workflows/node.yaml b/.github/workflows/node.yaml index e6fca5f..16cf3f7 100644 --- a/.github/workflows/node.yaml +++ b/.github/workflows/node.yaml @@ -12,11 +12,12 @@ jobs: build: env: CI: true - MONGO_TEST_URL: ${{ secrets.MONGO_TEST_URL }} + MONGO_URL: mongodb://localhost/nasa strategy: matrix: os: [ubuntu-latest] node-version: [18.x, 20.x] + mongodb-version: ['5.0', '6.0'] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -24,6 +25,10 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} + - name: MongoDB in GitHub Actions + uses: supercharge/mongodb-github-action@1.10.0 + with: + mongodb-version: ${{ matrix.mongodb-version }} - run: npm install - run: npm run build --prefix client - run: npm test diff --git a/server/tests/launches.test.js b/server/tests/launches.test.js index 7106413..ce3dbc3 100644 --- a/server/tests/launches.test.js +++ b/server/tests/launches.test.js @@ -8,7 +8,7 @@ const { const { loadPlanetsData } = require('../src/models/planets.model'); const app = require('../src/app'); -const USE_TEST_DB = true; +const USE_TEST_DB = !process.env.CI; beforeAll(async () => { await mongoConnect(USE_TEST_DB);