Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate trackRequests and testConfig #2373

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions addon/start-mirage.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ export default function startMirage(
makeServer = makeServer || resolveRegistration(owner, 'mirage:make-server');
}

deprecate(
'The testConfig option passed to startMirage has been deprecated. This was never documented and will no longer be supported. Please open an issue',
testConfig === undefined,
{
id: 'ember-cli-mirage-test-config',
for: 'ember-cli-mirage',
since: '2.4.0',
until: '3.0.0',
url: 'https://www.ember-cli-mirage.com/docs/advanced/server-configuration',
}
);

// Deprecate exporting makeServer as NOT the default function
deprecate(
'Do not export the makeServer function. Please make the makeServer function the default exported function',
Expand Down Expand Up @@ -96,6 +108,18 @@ export default function startMirage(
testConfig,
discoverEmberDataModels,
});

deprecate(
'The trackRequests environment variable has been deprecated. The trackRequests value should on the finalConfig sent to createServer of MirageJS',
mirageEnvironment.trackRequests === undefined,
{
id: 'ember-cli-mirage-config-track-requests',
for: 'ember-cli-mirage',
since: '2.4.0',
until: '3.0.0',
url: 'https://www.ember-cli-mirage.com/docs/advanced/server-configuration',
}
);
options.trackRequests = mirageEnvironment.trackRequests;
options.inflector = { singularize, pluralize };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ function routes() {
}
```

See [MirageJS documentation](https://miragejs.com/api/classes/server/) for other options.

## Serializers

If you would like to have Mirage adjust or create your serializers for you from your ember data serializers adjust your
Expand Down