Weekly retrospective notes

Jeff: Chai assert.isTrue() and isFalse

In Chai, assert.isTrue() / isFalse() do not give tracebacks in tests:

AssertionError: navigate not called once: expected false to be true
at http://0.0.0.0:8888/test/assets/chai.js:509
at http://0.0.0.0:8888/test/assets/chai.js:729
at http://0.0.0.0:8888/test/assets/chai.js:3154

If you use assert.equal(…, true) then you get a much more helpful output:

1) Application authentication creates a notification if logged in with a token:
AssertionError: navigate not called once: expected false to equal true
at http://0.0.0.0:8888/test/assets/chai.js:509
at http://0.0.0.0:8888/test/assets/chai.js:1930
at http://0.0.0.0:8888/test/test_app.js:447
at http://0.0.0.0:8888/test/utils.js:42

What do we do?  Three options.

  1. See if new version of chai is better and a drop-in
  2. Consider monkeypatch to switch isTrue to assert.equal(…, true) under the covers
  3. refactor every test to remove use of isTrue and isFalse and monkeypatch those out of the assert interface.

Rick: limitations in using git branches in charm

  • create a branch from any old commit
  • push any branch to your own fork
  • set the source to your fork and branch

@commit is only available for the develop branch of the official juju fork