Skip to content

Commit

Permalink
feat: loaded env variables with a more managable way
Browse files Browse the repository at this point in the history
  • Loading branch information
htuzel committed Nov 21, 2024
1 parent 623a45e commit 47c7681
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
9 changes: 7 additions & 2 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
const { defineConfig } = require("cypress");
require('dotenv').config();

module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) { // eslint-disable-line no-unused-vars
// implement node event listeners here if needed
setupNodeEvents(on, config) {
// Copy environment variables to Cypress config
config.env = config.env || {};
config.env.SANDBOX_HOST = process.env.SANDBOX_HOST;
// Important: return the updated config
return config;
},
},
});
1 change: 1 addition & 0 deletions cypress/e2e/variation.cy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/// <reference types="cypress" />
require('dotenv').config();

describe('Algolia Search', () => {
beforeEach(() => {
Expand Down
4 changes: 0 additions & 4 deletions cypress/fixtures/examples.json

This file was deleted.

0 comments on commit 47c7681

Please sign in to comment.