clean up callbacks during acceptance tests

This commit is contained in:
Sam
2018-05-24 15:28:54 +10:00
parent 4194886b62
commit 70179290f3
2 changed files with 6 additions and 0 deletions

View File

@@ -16,6 +16,10 @@ import { userPath } from 'discourse/lib/url';
const customPostMessageCallbacks = {};
export function resetCustomPostMessageCallbacks() {
customPostMessageCallbacks = {};
}
export function registerCustomPostMessageCallback(type, callback) {
if (customPostMessageCallbacks[type]) {
throw `Error ${type} is an already registered post message!`;