refactor: 💡 Update how we use ENABLE_MIRAGE to be consistent (#1362)
✅ Closes: ICU-6038
This commit is contained in:
1 parent
afe1e3ba3e
commit
4dda7ee3ba
4 files changed
+10
-11
No files matched your search
@@ -18,11 +18,6 @@ export default function () {
|
||||
// delay for each request, automatically set to 0 during testing
|
||||
this.timing = 1;
|
||||
|
||||
// Allow any configured API host to passthrough, which is useful in
|
||||
// development for testing against a locally running backend.
|
||||
if (config.api.host) this.passthrough(`${config.api.host}/**`);
|
||||
this.passthrough();
|
||||
|
||||
// Scope resources
|
||||
|
||||
this.get(
|
||||
|
||||
@@ -147,9 +147,9 @@ export default function initializeMockIPC(server, config) {
|
||||
* main process, and routes messages to it in a way similar to our
|
||||
* preload.js script.
|
||||
*
|
||||
* Initializes mock IPC only in a non-Electron non-testing context.
|
||||
* Initializes mock IPC only in a non-testing context and when mirage is turned on.
|
||||
*/
|
||||
if (!config.isElectron && !isTesting) {
|
||||
if (config['ember-cli-mirage'].enabled && !isTesting) {
|
||||
const mockIPC = new MockIPC();
|
||||
window.addEventListener('message', async function (event) {
|
||||
if (event.origin !== window.location.origin) return;
|
||||
|
||||
@@ -123,6 +123,10 @@ module.exports = function (environment) {
|
||||
// ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
|
||||
// ENV.APP.LOG_VIEW_LOOKUPS = true;
|
||||
|
||||
ENV['ember-cli-mirage'].enabled = process.env.ENABLE_MIRAGE
|
||||
? JSON.parse(process.env.ENABLE_MIRAGE)
|
||||
: true;
|
||||
|
||||
ENV['ember-a11y-testing'] = {
|
||||
componentOptions: {
|
||||
axeOptions: {
|
||||
|
||||
@@ -63,10 +63,6 @@ module.exports = function (environment) {
|
||||
},
|
||||
};
|
||||
|
||||
if (process.env.ENABLE_MIRAGE) {
|
||||
ENV['ember-cli-mirage'].enabled = JSON.parse(process.env.ENABLE_MIRAGE);
|
||||
}
|
||||
|
||||
if (environment === 'development') {
|
||||
// ENV.APP.LOG_RESOLVER = true;
|
||||
// ENV.APP.LOG_ACTIVE_GENERATION = true;
|
||||
@@ -79,6 +75,10 @@ module.exports = function (environment) {
|
||||
// usually the same as the application origin.
|
||||
ENV.autoOrigin = true;
|
||||
|
||||
ENV['ember-cli-mirage'].enabled = process.env.ENABLE_MIRAGE
|
||||
? JSON.parse(process.env.ENABLE_MIRAGE)
|
||||
: true;
|
||||
|
||||
// Enable features in development
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user