mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
drop usage of environment variables for neo4j in cypress:
- the default values in backend's neo4j.js are used
This commit is contained in:
parent
74a054e2b4
commit
b308b290aa
@ -2,11 +2,6 @@ const { defineConfig } = require("cypress");
|
|||||||
const browserify = require("@badeball/cypress-cucumber-preprocessor/browserify");
|
const browserify = require("@badeball/cypress-cucumber-preprocessor/browserify");
|
||||||
const { addCucumberPreprocessorPlugin } = require("@badeball/cypress-cucumber-preprocessor");
|
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
|
// Test persistent(between commands) store
|
||||||
const testStore = {}
|
const testStore = {}
|
||||||
|
|
||||||
@ -15,11 +10,6 @@ async function setupNodeEvents(on, config) {
|
|||||||
|
|
||||||
on("file:preprocessor", browserify.default(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", {
|
on("task", {
|
||||||
pushValue({ name, value }) {
|
pushValue({ name, value }) {
|
||||||
testStore[name] = value
|
testStore[name] = value
|
||||||
|
|||||||
@ -1,13 +1,7 @@
|
|||||||
import Factory from '../../backend/src/db/factories'
|
import Factory from '../../backend/src/db/factories'
|
||||||
import { getNeode } from '../../backend/src/db/neo4j'
|
import { getNeode } from '../../backend/src/db/neo4j'
|
||||||
|
|
||||||
|
const neodeInstance = getNeode()
|
||||||
const neo4jConfigs = {
|
|
||||||
uri: Cypress.env('NEO4J_URI'),
|
|
||||||
username: Cypress.env('NEO4J_USERNAME'),
|
|
||||||
password: Cypress.env('NEO4J_PASSWORD')
|
|
||||||
}
|
|
||||||
const neodeInstance = getNeode(neo4jConfigs)
|
|
||||||
|
|
||||||
beforeEach(() => cy.then(() => neodeInstance.cypher('MATCH (everything) DETACH DELETE everything;')))
|
beforeEach(() => cy.then(() => neodeInstance.cypher('MATCH (everything) DETACH DELETE everything;')))
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user