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

Add "Mirage logging" checkbox to QUnit user interface #1818

Merged
merged 3 commits into from
Nov 20, 2019

Conversation

Turbo87
Copy link
Collaborator

@Turbo87 Turbo87 commented Nov 16, 2019

Resolves #1783

Unfortunately, I had to add after: ember-qunit to the package.json to ensure that window.QUnit is actually defined already by the time that we try to register the QUnit option. Registering it later when the server is created is unfortunately not possible, since the options have to be defined already by the time that QUnit is running the tests.

/cc @samselikoff

addon/server.js Outdated Show resolved Hide resolved
vendor/add-qunit-option.js Outdated Show resolved Hide resolved
@rwjblue
Copy link
Collaborator

rwjblue commented Nov 17, 2019

Looks like CI is failing due to some sort of sourcemap concat issue:

Build Error (SourceMapConcat)
	ENOENT: no such file or directory, open '/home/travis/build/miragejs/ember-cli-mirage/test-projects/02-app-that-excludes-mirage/tmp/source_map_concat-input_base_path-WHbgHBql.tmp/vendor/add-qunit-option.js'

@rwjblue
Copy link
Collaborator

rwjblue commented Nov 17, 2019

My guess is that this is because the treeFor override results in no files in the vendor tree if _shouldIncludeFiles returns false, assuming that is the behavior we want I think that you'd need to wrap the app.import in a conditional.

This allows us to import the `add-qunit-option.js` file in the `included()` hook. This should not change anything else since we don't use the vendor folder/tree anywhere else.
@Turbo87
Copy link
Collaborator Author

Turbo87 commented Nov 18, 2019

@rwjblue yep, that was it. I've instead changed the treeFor() implementation to pass on the original vendor tree, since it wasn't used for anything else and needs to be explicitly imported from anyway.

@Turbo87 Turbo87 requested a review from samselikoff November 18, 2019 08:53
@rwjblue
Copy link
Collaborator

rwjblue commented Nov 18, 2019

Gotcha, makes sense!

@samselikoff
Copy link
Collaborator

This is awesome! Nice work <3

@samselikoff samselikoff merged commit 97f55e9 into miragejs:master Nov 20, 2019
@Turbo87 Turbo87 deleted the logging branch December 13, 2019 16:17
@Alonski
Copy link
Contributor

Alonski commented Dec 16, 2019

@samselikoff @Turbo87 Can we get a new release cut so that this can be used please? :)

@samselikoff
Copy link
Collaborator

Here ya go! https://github.com/miragejs/ember-cli-mirage/releases/tag/v1.1.6

@Alonski
Copy link
Contributor

Alonski commented Dec 16, 2019

Thanks @samselikoff !

bors added a commit to rust-lang/crates.io that referenced this pull request Dec 20, 2019
…age-1.1.6, r=Turbo87

Bump ember-cli-mirage from 0.4.7 to 1.1.6

Bumps [ember-cli-mirage](https://github.com/miragejs/ember-cli-mirage) from 0.4.7 to 1.1.6.
<details>
<summary>Release notes</summary>

*Sourced from [ember-cli-mirage's releases](https://github.com/miragejs/ember-cli-mirage/releases).*

> ## v1.1.6
> (Note: v1.1.5 was a bad release. v1.1.6 is the next release after v1.1.4.)
>
> **🚀 Enhancements**
> - [miragejs/ember-cli-mirage#1818](https://github-redirect.dependabot.com/miragejs/ember-cli-mirage/pull/1818) Adds "Mirage logging" checkbox to QUnit interface
>
>     This is a cool new feature added by [@&#8203;Turbo87](https://github.com/Turbo87)! Normally, Mirage doesn't log its responses to the console in the `test` environment, to keep your CI logs clean. If you're debugging a test and want to see what Mirage is returning, you need to add `server.logging = true` to the top of your test.
>
>     Now, instead of that, if you're using QUnit's interface you can toggle a new "Mirage logging" button
>
>     ![image](https://user-images.githubusercontent.com/2922250/70920189-25805180-1ff0-11ea-8fd4-b149da62d588.png)
>
>     This will enable Mirage's console logging, making it easier to debug your test without editing your test's source code. Thanks again to [@&#8203;Turbo87](https://github.com/Turbo87) for adding this feature!
>
> - https://github-redirect.dependabot.com/miragejs/ember-cli-mirage/pull/1820/files Remove unused deps (chalk, broccoli-string-replace) and dev-deps
>
> - miragejs/ember-cli-mirage@33645c3 Bump miragejs from 0.1.31 to 0.1.32
>
>
> **📝 Docs**
>
> - https://github-redirect.dependabot.com/miragejs/ember-cli-mirage/pull/1802/files Add documentation clarifying use of scenarios
> - [miragejs/ember-cli-mirage#1833](https://github-redirect.dependabot.com/miragejs/ember-cli-mirage/pull/1833) Fix broken intra-documentation links
> - [miragejs/ember-cli-mirage#1854](https://github-redirect.dependabot.com/miragejs/ember-cli-mirage/pull/1854) Fix relationship links
>
> **🏠 Internal**
>
> - Dep updates
>
> ## v1.1.4
> **🚀 Enhancements**
> - [miragejs/ember-cli-mirage#1791](https://github-redirect.dependabot.com/samselikoff/ember-cli-mirage/pull/1791) Switch `@miragejs/server` for `miragejs`. Just a new package name! No API changes.
> - [miragejs/ember-cli-mirage#1785](https://github-redirect.dependabot.com/samselikoff/ember-cli-mirage/pull/1785) Support for nested Mirage modules
>
> **📝 Docs**
> - [miragejs/ember-cli-mirage#1794](https://github-redirect.dependabot.com/samselikoff/ember-cli-mirage/pull/1794) Fix a mistake in Factories docs
> - [miragejs/ember-cli-mirage#1793](https://github-redirect.dependabot.com/samselikoff/ember-cli-mirage/pull/1793) Fix functions template
>
> **🏠 Internal**
> - Internal dependency updates
>
> ## v1.1.3
> 🐛 **Bugfixes**
> - [miragejs/ember-cli-mirage#1748](https://github-redirect.dependabot.com/samselikoff/ember-cli-mirage/issues/1748) Polymorphic relationships not serialized correctly
>
> 🏠 **Internal**
>
> - Bump @miragejs/server and other deps
>
> ## v1.1.2
></tr></table> ... (truncated)
</details>
<details>
<summary>Commits</summary>

- [`070545a`](miragejs/ember-cli-mirage@070545a) v1.1.6
- [`078b7b8`](miragejs/ember-cli-mirage@078b7b8) Replace samselikoff/ember-cli-mirage with miragejs/ember-cli-mirage
- [`22b6c73`](miragejs/ember-cli-mirage@22b6c73) v1.1.5
- [`e70da3f`](miragejs/ember-cli-mirage@e70da3f) Fix relationship links ([#1854](https://github-redirect.dependabot.com/miragejs/ember-cli-mirage/issues/1854))
- [`80fa6bf`](miragejs/ember-cli-mirage@80fa6bf) build(deps): bump ember-cli-babel from 7.13.0 to 7.13.2
- [`b958d56`](miragejs/ember-cli-mirage@b958d56) build(deps-dev): bump eslint-plugin-ember from 7.7.1 to 7.7.2
- [`5a94d3c`](miragejs/ember-cli-mirage@5a94d3c) build(deps-dev): bump ember-cli-htmlbars from 4.1.0 to 4.2.0
- [`d4331ce`](miragejs/ember-cli-mirage@d4331ce) build(deps-dev): bump ember-try from 1.3.0 to 1.4.0
- [`a8e6706`](miragejs/ember-cli-mirage@a8e6706) build(deps-dev): bump ember-cli-htmlbars from 4.0.9 to 4.1.0
- [`2d634c7`](miragejs/ember-cli-mirage@2d634c7) build(deps-dev): bump ember-cli-htmlbars from 4.0.8 to 4.0.9
- Additional commits viewable in [compare view](miragejs/ember-cli-mirage@v0.4.7...v1.1.6)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=ember-cli-mirage&package-manager=npm_and_yarn&previous-version=0.4.7&new-version=1.1.6)](https://dependabot.com/compatibility-score.html?dependency-name=ember-cli-mirage&package-manager=npm_and_yarn&previous-version=0.4.7&new-version=1.1.6)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

**Note:** This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

You can always request more updates by clicking `Bump now` in your [Dependabot dashboard](https://app.dependabot.com).

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "Mirage logging" checkbox to QUnit user interface
4 participants