drop usage of environment variables for neo4j in cypress:

- the default values in backend's neo4j.js are used
This commit is contained in:
mahula 2023-02-22 20:35:15 +01:00
parent 74a054e2b4
commit b308b290aa
2 changed files with 1 additions and 17 deletions

View File

@ -2,11 +2,6 @@ const { defineConfig } = require("cypress");
const browserify = require("@badeball/cypress-cucumber-preprocessor/browserify");
const { addCucumberPreprocessorPlugin } = require("@badeball/cypress-cucumber-preprocessor");
const dotenv = require('dotenv');
// Import backend .env (smart)?
const { parsed } = dotenv.config({ path: require.resolve('../backend/.env') });
// Test persistent(between commands) store
const testStore = {}
@ -15,11 +10,6 @@ async function setupNodeEvents(on, config) {
on("file:preprocessor", browserify.default(config));
config.env.NEO4J_URI = parsed.NEO4J_URI
config.env.NEO4J_USERNAME = parsed.NEO4J_USERNAME
config.env.NEO4J_PASSWORD = parsed.NEO4J_PASSWORD
config.env.JWT_SECRET = parsed.JWT_SECRET
on("task", {
pushValue({ name, value }) {
testStore[name] = value

View File

@ -1,13 +1,7 @@
import Factory from '../../backend/src/db/factories'
import { getNeode } from '../../backend/src/db/neo4j'
const neo4jConfigs = {
uri: Cypress.env('NEO4J_URI'),
username: Cypress.env('NEO4J_USERNAME'),
password: Cypress.env('NEO4J_PASSWORD')
}
const neodeInstance = getNeode(neo4jConfigs)
const neodeInstance = getNeode()
beforeEach(() => cy.then(() => neodeInstance.cypher('MATCH (everything) DETACH DELETE everything;')))