-
-
Save rwjblue/bbfa75170ea7287a3dc71c9c647f4f4e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function setupTest(options) { | |
let originalContext = {}; | |
beforeEach(function() { | |
Ember.assign(originalContext, this); | |
return setupContext(this, options).then(() => { | |
// *** FIXME *** | |
let originalPauseTest = this.pauseTest; | |
this.pauseTest = function Mocha_pauseTest() { | |
this.timeout(-1); // prevent the test from timing out | |
return originalPauseTest.call(this); | |
}; | |
}); | |
}); | |
afterEach(function() { | |
return teardownContext(this).then(() => { | |
// delete any extraneous properties | |
for (let key in this) { | |
if (!(key in originalContext)) { | |
delete this[key]; | |
} | |
} | |
// copy over the original values | |
Ember.assign(this, originalContext); | |
}); | |
}); | |
} | |
export function setupRenderingTest(options) { | |
setupTest(options); | |
beforeEach(function() { | |
return setupRenderingContext(this); | |
}); | |
afterEach(function() { | |
return teardownRenderingContext(this); | |
}); | |
} | |
export function setupApplicationTest(options) { | |
setupTest(options); | |
beforeEach(function() { | |
return setupApplicationContext(this); | |
}); | |
afterEach(function() { | |
return teardownApplicationContext(this); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment