{"action":"created","issue":{"url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/1263","repository_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage","labels_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/1263/labels{/name}","comments_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/1263/comments","events_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/1263/events","html_url":"https://github.com/samselikoff/ember-cli-mirage/pull/1263","id":297693038,"number":1263,"title":"Fix RFC232/268 tests","user":{"login":"bendemboski","id":559001,"avatar_url":"https://avatars3.githubusercontent.com/u/559001?v=4","gravatar_id":"","url":"https://api.github.com/users/bendemboski","html_url":"https://github.com/bendemboski","followers_url":"https://api.github.com/users/bendemboski/followers","following_url":"https://api.github.com/users/bendemboski/following{/other_user}","gists_url":"https://api.github.com/users/bendemboski/gists{/gist_id}","starred_url":"https://api.github.com/users/bendemboski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bendemboski/subscriptions","organizations_url":"https://api.github.com/users/bendemboski/orgs","repos_url":"https://api.github.com/users/bendemboski/repos","events_url":"https://api.github.com/users/bendemboski/events{/privacy}","received_events_url":"https://api.github.com/users/bendemboski/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-16T06:32:21Z","updated_at":"2018-03-01T18:35:39Z","closed_at":"2018-03-01T18:30:55Z","author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/pulls/1263","html_url":"https://github.com/samselikoff/ember-cli-mirage/pull/1263","diff_url":"https://github.com/samselikoff/ember-cli-mirage/pull/1263.diff","patch_url":"https://github.com/samselikoff/ember-cli-mirage/pull/1263.patch"},"body":"## PR summary\r\n\r\nThe end result of this PR is:\r\n\r\n* RFC232/RFC268 tests are now supported properly\r\n* The `server` global is no longer necessary in RFC232/RFC268 tests, so at some point it can be deprecated\r\n\r\nThis also involved updating to `ember-cli@2.18.2` (and some associated linting fixes), which is in its own commit.\r\n\r\nThis is all backwards-compatible.\r\n\r\nFixes #1257 \r\n\r\n## How it works in different types of tests\r\n\r\n* **Old-style non-acceptance tests**: mirage will not automatically start, and can still be manually started using the `startMirage()` import from `<app>/initializers/ember-cli-mirage`.\r\n* **OId-style acceptance tests**: mirage will still be started before each test by `<app>/initializers/ember-cli-mirage` and shut down by the code that `ember-cli-mirage`'s blueprint adds to `destroyApp()`.\r\n* **RFC232 and RFC268 tests**: `<app>/initializers/ember-cli-mirage` will detect that it's an RFC232/RFC268 test and not start the mirage server automatically in the way that is problematic for the new tests, and since the new tests don't use `destroyApp()`, it's not at play either. So there are two options:\r\n  - In each test that needs it, the user can call `setupMirageTest()`, which will register `beforeEach`/`afterEach` hooks to set up and shut down the mirage server and make it accessible via `this.server` (and also the `server` global).\r\n  - The user can set `autostart: true` in their `ember-cli-mirage` config object in `config/environment` which will cause an instance initializer that runs before each test (**every** RFC232/RFC268 test, not just \"acceptance\" (application) tests) to start mirage and set it as `this.server` on the test context (and also the `server` global), and also register and create a singleton that, when destroyed during app shutdown, will shut down the mirage server.\r\n\r\n## Upgrade path\r\n\r\nThis is **not** a breaking change -- existing tests will run just as they are once this PR is merged and released. Furthermore, new and old tests can live side by side and work properly with mirage if the right setup is done, so users are not forced to migrate their whole suite all at once. As they migrate tests, they have two options:\r\n\r\n* As non-acceptance tests are migrated, delete the manual starting/stopping of mirage in `beforeEach`/`afterEach` and replace it with a call to `setupMirageTest()` and continue using `this.server`. As acceptance tests are migrated, add a call to `setupMirageTest()` and optionally switch from using the `server` global to using `this.server`.\r\n* Set `autostart: true` in `config/environment`, and then as non-acceptance tests are migrated, just delete the manual starting/stopping of the mirage server and continue using `this.server`. As acceptance tests are migrated, no changes are necessary, but users can optionally switch from using the `server` global to using `this.server`."},"comment":{"url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/comments/369687216","html_url":"https://github.com/samselikoff/ember-cli-mirage/pull/1263#issuecomment-369687216","issue_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/1263","id":369687216,"user":{"login":"samselikoff","id":2922250,"avatar_url":"https://avatars1.githubusercontent.com/u/2922250?v=4","gravatar_id":"","url":"https://api.github.com/users/samselikoff","html_url":"https://github.com/samselikoff","followers_url":"https://api.github.com/users/samselikoff/followers","following_url":"https://api.github.com/users/samselikoff/following{/other_user}","gists_url":"https://api.github.com/users/samselikoff/gists{/gist_id}","starred_url":"https://api.github.com/users/samselikoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samselikoff/subscriptions","organizations_url":"https://api.github.com/users/samselikoff/orgs","repos_url":"https://api.github.com/users/samselikoff/repos","events_url":"https://api.github.com/users/samselikoff/events{/privacy}","received_events_url":"https://api.github.com/users/samselikoff/received_events","type":"User","site_admin":false},"created_at":"2018-03-01T18:35:39Z","updated_at":"2018-03-01T18:35:39Z","author_association":"OWNER","body":"Thank you so much for this, and sorry about the delay!"}}
{"actor":{"display_login":"samselikoff"}}