Ensure that the Application.start static method uses overridden class #603
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.
const application = MyApplication.start()
- it now will use the actualMyApplication
class instead of the non-extendedApplication
classNotes
I opted for no documentation here - I think this behaviour would be expected and also aligns with any manual
start
usage with instantiation of the class yourself.For example, the following two ways of starting the application will now be the same (with this PR merged).
A - Starting an application as per documentation
B - Setting up the instance manually & running
start
Test format
Note that I had to write my own test case class as
src/tests/cases/application_test_case.ts
does not use the documentedApplication.start()
approach (due to other tests relying on a separate setup step for the application before starting).This is similar to the way that the test file
src/tests/modules/core/error_handler_tests.ts
also sets up its own test case but without the double-registration of a Stimulus application. Happy to adjust if this is not the way we want to do this.