mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
neodes withDir seems incompatible with cypress
This commit is contained in:
parent
e4173a24aa
commit
a3de375fef
@ -1,8 +1,9 @@
|
||||
import Neode from 'neode'
|
||||
import models from '../models'
|
||||
|
||||
export default function setupNeode(options) {
|
||||
const { uri, username, password } = options
|
||||
const neodeInstance = new Neode(uri, username, password)
|
||||
neodeInstance.withDirectory(`${__dirname}/../models`)
|
||||
neodeInstance.with(models)
|
||||
return neodeInstance
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import Factory from '../../seed/factories'
|
||||
import { neode } from '../../bootstrap/neo4j'
|
||||
import Factory from '../seed/factories'
|
||||
import { neode } from '../bootstrap/neo4j'
|
||||
|
||||
const factory = Factory()
|
||||
const instance = neode()
|
||||
13
backend/src/models/index.js
Normal file
13
backend/src/models/index.js
Normal file
@ -0,0 +1,13 @@
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
const models = {}
|
||||
fs.readdirSync(__dirname).forEach(file => {
|
||||
file = path.join(__dirname, file).toString('utf-8')
|
||||
const name = path.basename(file, '.js')
|
||||
if (!/\.spec/.test(name) && path.extname(file) === '.js') {
|
||||
// Is a gql file
|
||||
models[name] = require(file)
|
||||
}
|
||||
})
|
||||
export default models
|
||||
Loading…
x
Reference in New Issue
Block a user