Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Test assertions are broken #5722

Closed
dcposch opened this issue Nov 18, 2016 · 3 comments
Closed

Test assertions are broken #5722

dcposch opened this issue Nov 18, 2016 · 3 comments

Comments

@dcposch
Copy link
Contributor

dcposch commented Nov 18, 2016

While adding a new unit test, I noticed that some of the existing unit tests are not actually testing anything.

For example, in urlutilTest.js:

  describe('getScheme', function () {
    // ...
    it('localhost: for localhost', function * () {
      assert.equal(UrlUtil.getScheme('localhost://127.0.0.1'), 'localhost:')
    })

...if you replace 'localhost:' with 'yolo', the tests still pass!

Looks like we can fix this by removing generator functions. In other words, turning function * into function.

@dcposch
Copy link
Contributor Author

dcposch commented Nov 18, 2016

@bbondy

@bsclifton
Copy link
Member

Good catch 😄 That should be easy enough to update. All of the unit tests should be using regular function

@bbondy
Copy link
Member

bbondy commented Nov 22, 2016

Yikes nice find, thanks for the ping @dcposch

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants