Ghost/ghost/admin/tests/helpers/adapter-error.js
Kevin Ansfield e74e2e039e Update code to match eslint rules
no issue
- switch `jscs` and `jshint` inline config to `eslint` config
- fix eslint errors, predominantly in tests where the config now the main app config more closely
2016-11-14 13:26:00 +00:00

23 lines
638 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, 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;
}