-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Added mocks and logging #24743
Added mocks and logging #24743
Conversation
* https://github.com/elastic/ingest-dev/issues/54 * Added test mocks to GraphQL * Added logging * Added unit tests
For testing the mocks: export INGEST_MOCKS=true
yarn start --no-base-path Go here:
Add this to your GraphIQ to trigger the mock test: query test {
source(id: "default") {
id,
configuration {
fields {
host
}
}
}
} Add this to your GraphIq to trigger the mock test for allSources query test {
allSources {
id,configuration {
fields {
container,
host,
message,
}
}
}
} |
💔 Build Failed |
retest |
I think that it is failling because you declare |
💔 Build Failed |
|
||
import { amMocking } from './kibana.index'; | ||
|
||
const createMockServer = () => ({ log: jest.fn() }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead variable causing build to fail.
describe('#createLogger', () => { | ||
test('should log out debug', () => { | ||
const kbnServer = createMockServer(); | ||
const logger = createLogger(kbnServer as any); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in the logger one, I should follow the no any
advice even with tests where possible. I have a lot of:
const logger = createLogger(kbnServer as any);
I think I can change the logger interface to only use the hapi Logger
interface instead of pushing the whole Kibana Server in. Let me try that and see what happens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created issue for this per conversation to keep things moving forward quickly:
https://github.com/elastic/ingest-dev/issues/73
💚 Build Succeeded |
* Added mocks and logging * https://github.com/elastic/ingest-dev/issues/54 * Added test mocks to GraphQL * Added logging * Added unit tests * Removed dead variable causing the build to fail
Added mocks and logging