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

Fix proxies for property assertions #205

Merged
merged 1 commit into from
Jul 2, 2017
Merged

Fix proxies for property assertions #205

merged 1 commit into from
Jul 2, 2017

Conversation

meeber
Copy link
Contributor

@meeber meeber commented Jun 10, 2017

This PR fixes Chai 4's proxy protection for property assertions. Without this fix, proxy protection works for method assertions and chainable method assertions, but not property assertions. The reason it doesn't work for property assertions is because the getters for property assertions incidentally de-proxify the assertion object before returning it. This PR re-proxifies those de-proxified assertion objects from property assertions before returning them.

@meeber
Copy link
Contributor Author

meeber commented Jun 11, 2017

Just rebased this. The build is failing because the test suite currently only supports Chai v4 due to the breaking change related to the .nested flag.

@domenic
Copy link
Collaborator

domenic commented Jun 11, 2017

The test suite on master passes; why does this change break the test suite?

@domenic
Copy link
Collaborator

domenic commented Jun 11, 2017

The test suite has also now been converted to JavaScript, so I'd prefer if we had some tests for this functionality.

@meeber
Copy link
Contributor Author

meeber commented Jun 11, 2017

Whoops my mistake; need to check that proxify is defined before using it. Will take a look at it later.

@meeber
Copy link
Contributor Author

meeber commented Jun 14, 2017

Updated with tests. Note that these tests are skipped if proxies aren't supported or if Chai's proxify util isn't available. In other words, they're currently only run in the "Node.js: stable / CHAI_VERSION=^4.0.0" job.

@domenic
Copy link
Collaborator

domenic commented Jul 2, 2017

Eek, sorry about forgetting this. Merging and releasing now...

@domenic domenic merged commit 248810a into chaijs:master Jul 2, 2017
bors bot added a commit to IMA-WorldHealth/bhima that referenced this pull request Jul 13, 2017
1826: Correct some lint errors r=jniles

This PR fixes some errors of eslint to make sure the repository still clean
Thank you for contributing!

Before submitting this pull request, please verify that you have:
 - [x] Run your code through ESLint.  [Check out our styleguide](https://github.com/IMA-WorldHealth/bhima-2.X/blob/master/docs/STYLEGUIDE.md).
 - [x] Run integration tests.
 - [x] Run end-to-end tests.
 - [x] Accurately described the changes your are making in this pull request.

For a more detailed checklist, [see the official review checklist](https://docs.google.com/document/d/1nupLVLRXgSZJQo_acLgrwvPnN8RukfSiwRhSToj81uU/pub) that this PR will be evaluated against.

Ensuring that the above checkboxes are completed will help speed the review process and help build a stronger application.  Thanks!


1827: Update chai-as-promised to the latest version 🚀 r=jniles


## Version **7.1.0** of [chai-as-promised](https://github.com/domenic/chai-as-promised) just got published.

<table>
  <tr>
    <th align=left>
      Dependency
    </td>
    <td>
      chai-as-promised
    </td>
  </tr>
  <tr>
    <th align=left>
      Current Version
    </td>
    <td>
      6.0.0
    </td>
  </tr>
  <tr>
    <th align=left>
      Type
    </td>
    <td>
      devDependency
    </td>
  </tr>
</table>

The version **7.1.0** is **not covered** by your **current version range**.

Without accepting this pull request your project will work just like it did before. There might be a bunch of new features, fixes and perf improvements that the maintainers worked on for you though.

I recommend you look into these changes and try to get onto the latest version of chai-as-promised.
Given that you have a decent test suite, a passing build is a strong indicator that you can take advantage of these changes by merging the proposed change into your project. Otherwise this branch is a great starting point for you to work on the update.


---


<details>
<summary>Release Notes</summary>
<strong>7.1.0</strong>

<p>Fixes Chai's proxy protection for property assertions (when using Chai v4 or higher). (<a href="https://urls.greenkeeper.io/meeber" class="user-mention">@meeber</a>, <a href="https://urls.greenkeeper.io/domenic/chai-as-promised/pull/205" class="issue-link js-issue-link" data-url="chaijs/chai-as-promised#205" data-id="235023818" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">#205</a>)</p>
</details>

<details>
<summary>Commits</summary>
<p>The new version differs by 8 commits.</p>
<ul>
<li><a href="https://urls.greenkeeper.io/domenic/chai-as-promised/commit/4c2d628de0be636077e669c3aeb7d3a87ce21971"><code>4c2d628</code></a> <code>7.1.0</code></li>
<li><a href="https://urls.greenkeeper.io/domenic/chai-as-promised/commit/248810a508b94ca47473b9385aea2f9f151168a1"><code>248810a</code></a> <code>Fix proxies for property assertions (#205)</code></li>
<li><a href="https://urls.greenkeeper.io/domenic/chai-as-promised/commit/a60bf923d25f464a36a3d6ff4958137c397e1336"><code>a60bf92</code></a> <code>7.0.0</code></li>
<li><a href="https://urls.greenkeeper.io/domenic/chai-as-promised/commit/a92de93caea9803c11736a1208234d3be7d3a42c"><code>a92de93</code></a> <code>Convert tests away from CoffeeScript</code></li>
<li><a href="https://urls.greenkeeper.io/domenic/chai-as-promised/commit/ce2d4cb04bad5b2ea10f4bd5b74fdcc54ab89227"><code>ce2d4cb</code></a> <code>Add a note about using other Chai plugins</code></li>
<li><a href="https://urls.greenkeeper.io/domenic/chai-as-promised/commit/e8021e44021e769e1eed4dfdd85856b365287870"><code>e8021e4</code></a> <code>Update for Chai v4.0</code></li>
<li><a href="https://urls.greenkeeper.io/domenic/chai-as-promised/commit/16dde11e8d566771681dd6c39fd28716c9de69fa"><code>16dde11</code></a> <code>Various cleanups and updates</code></li>
<li><a href="https://urls.greenkeeper.io/domenic/chai-as-promised/commit/0dfd21181193bb1fd46664b35893bac75df6b004"><code>0dfd211</code></a> <code>Test all supported versions of Chai; assume Node v4+</code></li>
</ul>
<p>See the <a href="https://urls.greenkeeper.io/domenic/chai-as-promised/compare/b2cfbdc71360dad1faaa29f64bcc8ba54819084e...4c2d628de0be636077e669c3aeb7d3a87ce21971">full diff</a></p>
</details>

<details>
  <summary>Not sure how things should work exactly?</summary>

  There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html) and of course you may always [ask my humans](https://github.com/greenkeeperio/greenkeeper/issues/new).
</details>


---


Your [Greenkeeper](https://greenkeeper.io) Bot 🌴
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants