test: expand unit coverage for service + initializer#56
Closed
TheRealAgentK wants to merge 1 commit into
Closed
Conversation
Adds 18 new tests, raising total from 9 to 26 (excluding the ember-qunit
harness check). Closes the test-gap items called out in AGENTS.md §8.7.
Service (tests/unit/services/raygun-test.js):
- setUser forwards args to rg4js('setUser', ...)
- trackEvent supports the pageView payload shape
- apiKey, enableCrashReporting, enablePulse setters call rg4js with the
correct command + value, and getters round-trip
- New 'when rg4js is unavailable' submodule verifies graceful
degradation: send/setUser/trackEvent return null + warn; the three
property setters are no-ops + warn
Instance initializer (tests/unit/instance-initializers/raygun-test.js):
- RSVP.on('error') handler is registered and forwards { error } to
raygun.send
- applicationInstance.onerror is wrapped and routes errors to
raygun.send
- A previously-installed onerror handler is preserved (chained), not
replaced
- router.routeDidChange subscription is created and emits a
trackEvent({ type: 'pageView', path: ... }) per transition
- When enableCrashReporting is false: no RSVP handler, no onerror
replacement, no routeDidChange subscription
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closing — these test additions have been rolled into #55, which now contains both the dependency cleanup and the expanded test coverage as a single combined PR.