Jump to content

Talk:Reading/Web/QUnit test guidelines

About this board

"Always use assert.strictEqual(); never use assert.equal()."

2
Jdlrobson (talkcontribs)

There are some cases where using equals makes more sense - particularly when testing attributes

Consider the following case:

const width = otherParam - anotherParam + 10; strictEquals( $foo.attr('width'), width ) strictEquals( $foo.data('x-y-z-width'), width )

Doing the following seems overkill to me, given data could also be stored as an integer: const width = otherParam - anotherParam + 10; strictEquals( parseInt( $foo.attr('width'), 10 ), width )

Jdlrobson (talkcontribs)

In Page previews I see a frequent reoccurrence of "Number.parseFloat( thumbnail.el.attr( 'height' ) )," to workaround this.

Reply to ""Always use assert.strictEqual(); never use assert.equal().""
There are no older topics