mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
069bccdd94
no issue - keymaster bindings could be kept around between tests with references to objects that should have been deleted. This was manifesting itself with a Tags acceptance test failing because one of the key binding tests triggered two actions, one on the route under test and another on a route that was kept around from a previous Error Handling acceptance test (previous test intentionally had an aborted transition so the action in the current test was complaining about the first transition not being complete) - add guard to ensure that shortcuts can't be registered multiple times on an object - remove all `default` scope keymaster bindings when destroying a test app instance
16 lines
417 B
JavaScript
16 lines
417 B
JavaScript
/* global key */
|
|
import {run} from '@ember/runloop';
|
|
|
|
export default function destroyApp(application) {
|
|
// this is required to fix "second Pretender instance" warnings
|
|
if (server) {
|
|
server.shutdown();
|
|
}
|
|
|
|
// extra check to ensure we don't have references hanging around via key
|
|
// bindings on supposedly destroyed objects
|
|
key.deleteScope('default');
|
|
|
|
run(application, 'destroy');
|
|
}
|