Skip to content

How should plugins perform a "final" test? #1663

@Krinkle

Description

@Krinkle

Following from #1629, the ember-cli-memory-leak-detector plugin used QUnit.done() to register a final test.

This no longer works as of #1629. In that PR, I stated that this was already unreliable and could be ignored silently without realizing. But, it's also quite possible that it happened to work reliably for all cases that mattered for the specific way in which ember-cli and Testem aggregate test results.

This ticket is to determine (and make if needed) a viable way for plugins to register a "final" test, and to make sure it is documented going forward.

@steveszc wrote:

[it] is breaking some functionality in https://github.com/steveszc/ember-cli-memory-leak-detector

My use-case is that I need to inject a test after all other tests have finished running (once the tests finish I capture a heap snapshot, search it for memory leaks created during the test run, and create a new test that either passes or fails depending on whether memory leaks were found).

I previously relied on the (apparently unintentional) ability to create a test after the test suite has finished. I understand that I have a rather unconventional use-case but it would great if I can continue reporting memory leaks as a failed test within Qunit as it provides a great DX.

Is there a way to do this moving forward?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: CoreFor module, test, hooks, and reporters.Type: MetaSeek input from maintainers and contributors.Type: QuestionAsk questions or seek assistance.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions