Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nice GQL tests config #854

Merged
merged 10 commits into from Aug 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/core-graphql/__tests__/__support__/config/peers.json
@@ -0,0 +1,12 @@
{
"minimumVersion": ">=1.1.1",
"minimumNetworkReach": 5,
"globalTimeout": 5000,
"coldStart": 30,
"whiteList":[],
"blackList": [],
"list": [{
"ip": "127.0.0.1",
"port": 4000
}]
}
29 changes: 29 additions & 0 deletions packages/core-graphql/__tests__/__support__/config/plugins.js
@@ -0,0 +1,29 @@
module.exports = {
'@arkecosystem/core-config': {},
'@arkecosystem/core-logger': {},
'@arkecosystem/core-logger-winston': {
transports: {
console: {
options: {
colorize: true,
level: process.env.ARK_LOG_LEVEL || 'debug'
}
},
dailyRotate: {
options: {
filename: process.env.ARK_LOG_FILE || `${process.env.ARK_PATH_DATA}/logs/core/${process.env.ARK_NETWORK_NAME}/%DATE%.log`,
datePattern: 'YYYY-MM-DD',
level: process.env.ARK_LOG_LEVEL || 'debug',
zippedArchive: true
}
}
}
},
'@arkecosystem/core-graphql': {
enabled: true,
host: 'localhost',
port: 4005,
path: '/graphql',
graphiql: true
}
}
14 changes: 4 additions & 10 deletions packages/core-graphql/__tests__/__support__/setup.js
Expand Up @@ -4,21 +4,15 @@ const path = require('path')
const container = require('@arkecosystem/core-container')

exports.setUp = async () => {
jest.setTimeout(60000)

process.env.ARK_GRAPHQL_ENABLED = true
process.env.ARK_GRAPHQL_HOST = 'localhost'
process.env.ARK_GRAPHQL_PORT = 4005

await container.setUp({
data: '~/.ark',
config: path.resolve(__dirname, '../../../core/lib/config/testnet'),
token: 'ark',
network: 'testnet'
config: path.resolve(__dirname, './config'),
network: 'testnet',
token: 'ark'
}, {
})

return container
}

exports.tearDown = async () => container.tearDown()
exports.tearDown = () => container.tearDown()
7 changes: 3 additions & 4 deletions packages/core-graphql/__tests__/graphql.test.js
@@ -1,14 +1,13 @@
const app = require('./__support__/setup')

let graphql
let container

beforeAll(async () => {
container = await app.setUp()
graphql = container.resolvePlugin('graphql')
const container = await app.setUp()
graphql = await container.resolvePlugin('graphql')
})

afterAll(async () => {
afterAll(() => {
app.tearDown()
})

Expand Down