mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 07:09:48 +03:00
24 lines
642 B
JavaScript
24 lines
642 B
JavaScript
import Ember from 'ember';
|
|
import Test from 'ember-test';
|
|
|
|
// This is needed for testing error responses in acceptance tests
|
|
// See http://williamsbdev.com/posts/testing-rsvp-errors-handled-globally/
|
|
|
|
// ember-cli-shims doesn't export Logger
|
|
const {Logger} = Ember;
|
|
|
|
let originalException;
|
|
let originalLoggerError;
|
|
|
|
export function errorOverride() {
|
|
originalException = Test.adapter.exception;
|
|
originalLoggerError = Logger.error;
|
|
Test.adapter.exception = function () {};
|
|
Logger.error = function () {};
|
|
}
|
|
|
|
export function errorReset() {
|
|
Test.adapter.exception = originalException;
|
|
Logger.error = originalLoggerError;
|
|
}
|