balderdashy / waterline-adapter-tests

API integration tests for Waterline adapters
MIT License
16 stars 41 forks source link

30: replace assert(a == b) for assert.equal(a, b) #70

Closed dmarcelino closed 9 years ago

dmarcelino commented 9 years ago

Fixes #30 and improves on PR #69.

PR #69 blindly replaces all strict === comparisons for assert.equal(), this PR replaces:

PR #69 original text:

Fixes #30 by replacing instances of assert(a === b) for assert.equal(a, b). For those curious this was done with sed:

find . -name '*.js' -type f -print0 | xargs -0 sed -i '' 's/assert(\([^|&]*\) ===\([^|&]*\))/assert.equal(\1,\2)/g'

I've checked the number of tests ran was the same before and after the change and visually inspected all changes so we should be good.

Original issue:

Specifically, assert.equal should always be used with strings. Some string comparisons will fail triple-equality check. I've run into this in getting the tests to pass in the couch adapter.

From a UX perspective, the methods will produce more helpful and descriptive failure messages.

cc: @tjwebb, @devinivy

dmarcelino commented 9 years ago

We should do the same for waterline core.

devinivy commented 9 years ago

Wild! This looks good :+1:

dmarcelino commented 9 years ago

Thanks @devinivy! I'll merge this now because any other PR will probably cause merge conflicts in this.