-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(onboarding): Add hapi, fastify and Nest.js (#70647)
Will merge this after v8 is out for a while (like 1 week or so). --------- Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
- Loading branch information
Showing
26 changed files
with
957 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import {renderWithOnboardingLayout} from 'sentry-test/onboarding/renderWithOnboardingLayout'; | ||
import {screen} from 'sentry-test/reactTestingLibrary'; | ||
import {textWithMarkupMatcher} from 'sentry-test/utils'; | ||
|
||
import {ProductSolution} from 'sentry/components/onboarding/productSelection'; | ||
|
||
import docs from './fastify'; | ||
|
||
describe('fastify onboarding docs', function () { | ||
it('renders onboarding docs correctly', () => { | ||
renderWithOnboardingLayout(docs); | ||
|
||
// Renders main headings | ||
expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument(); | ||
expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument(); | ||
expect(screen.getByRole('heading', {name: 'Upload Source Maps'})).toBeInTheDocument(); | ||
expect(screen.getByRole('heading', {name: 'Verify'})).toBeInTheDocument(); | ||
|
||
// Includes import statement | ||
const allMatches = screen.getAllByText( | ||
textWithMarkupMatcher(/import \* as Sentry from "@sentry\/node"/) | ||
); | ||
allMatches.forEach(match => { | ||
expect(match).toBeInTheDocument(); | ||
}); | ||
}); | ||
|
||
it('includes error handler', () => { | ||
renderWithOnboardingLayout(docs); | ||
|
||
expect( | ||
screen.getByText(textWithMarkupMatcher(/Sentry\.setupFastifyErrorHandler\(app\)/)) | ||
).toBeInTheDocument(); | ||
}); | ||
|
||
it('displays sample rates by default', () => { | ||
renderWithOnboardingLayout(docs, { | ||
selectedProducts: [ | ||
ProductSolution.ERROR_MONITORING, | ||
ProductSolution.PERFORMANCE_MONITORING, | ||
ProductSolution.PROFILING, | ||
], | ||
}); | ||
|
||
expect( | ||
screen.queryByText(textWithMarkupMatcher(/tracesSampleRate/)) | ||
).toBeInTheDocument(); | ||
expect( | ||
screen.queryByText(textWithMarkupMatcher(/profilesSampleRate/)) | ||
).toBeInTheDocument(); | ||
}); | ||
|
||
it('enables performance setting the tracesSampleRate to 1', () => { | ||
renderWithOnboardingLayout(docs, { | ||
selectedProducts: [ | ||
ProductSolution.ERROR_MONITORING, | ||
ProductSolution.PERFORMANCE_MONITORING, | ||
], | ||
}); | ||
|
||
expect( | ||
screen.getByText(textWithMarkupMatcher(/tracesSampleRate: 1\.0/)) | ||
).toBeInTheDocument(); | ||
}); | ||
|
||
it('enables profiling by setting profiling samplerates', () => { | ||
renderWithOnboardingLayout(docs, { | ||
selectedProducts: [ProductSolution.ERROR_MONITORING, ProductSolution.PROFILING], | ||
}); | ||
|
||
expect( | ||
screen.getByText( | ||
textWithMarkupMatcher( | ||
/const { nodeProfilingIntegration } = require\("@sentry\/profiling-node"\)/ | ||
) | ||
) | ||
).toBeInTheDocument(); | ||
expect( | ||
screen.getByText(textWithMarkupMatcher(/profilesSampleRate: 1\.0/)) | ||
).toBeInTheDocument(); | ||
}); | ||
}); |
Oops, something went wrong.