mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-07 03:22:21 +03:00
cf36851265
replaces #41, #60 - update ember-suave and grunt-jscs to 3.0 - standardize Ember global de-structuring rules across app & tests
22 lines
576 B
JavaScript
22 lines
576 B
JavaScript
import Ember from 'ember';
|
|
|
|
// This is needed for testing error responses in acceptance tests
|
|
// See http://williamsbdev.com/posts/testing-rsvp-errors-handled-globally/
|
|
|
|
const {Test, 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;
|
|
}
|