diff --git a/cypress/integration/unit/test1.js b/cypress/integration/unit/test1.js index 9ba41d3b..5ff34974 100644 --- a/cypress/integration/unit/test1.js +++ b/cypress/integration/unit/test1.js @@ -129,7 +129,7 @@ describe('Basic Module', function () { fu = document.getElementById('foreign-use'), nfu = document.getElementById('no-use'); - assert.equal((u && u.nodeName === 'use'), true, 'Did not import element'); + assert.equal((u && u.nodeName), 'use', 'Did not import element'); assert.equal(fu, null, 'Removed element that had a foreign href'); assert.equal(nfu, null, 'Removed element that had no href'); }); @@ -145,7 +145,7 @@ describe('Basic Module', function () { const t = document.getElementById('the-text'); - assert.equal((t && t.nodeName === 'text'), true, 'Did not import element'); + assert.equal((t && t.nodeName), 'text', 'Did not import element'); assert.equal(t.getAttribute('d'), null, 'Imported a with a d attribute'); }); @@ -159,7 +159,7 @@ describe('Basic Module', function () { ); const attrVal = document.getElementById('se_test_elem').getAttributeNS('http://svg-edit.googlecode.com', 'foo'); - assert.equal(attrVal === 'bar', true, 'Preserved namespaced attribute on import'); + assert.strictEqual(attrVal, 'bar', true, 'Preserved namespaced attribute on import'); const output = svgCanvas.getSvgString(); // } catch(e) {console.log(e)} diff --git a/cypress/integration/unit/utilities-performance.js b/cypress/integration/unit/utilities-performance.js index a23e20ba..4e1e0e9a 100644 --- a/cypress/integration/unit/utilities-performance.js +++ b/cypress/integration/unit/utilities-performance.js @@ -207,7 +207,7 @@ describe('utilities performance', function () { } total = lastTime - start; const ave = total / count; - assert.ok(ave < 20, 'svgedit.utilities.getStrokedBBox average execution time is less than 20 ms'); + assert.isBelow(ave, 20, 'svgedit.utilities.getStrokedBBox average execution time is less than 20 ms'); console.log('Pass1 svgCanvas.getStrokedBBox total ms ' + total + ', ave ms ' + ave.toFixed(1) + ',\t min/max ' + min + ' ' + max); // eslint-disable-next-line promise/avoid-new @@ -229,7 +229,7 @@ describe('utilities performance', function () { total = lastTime - strt; const avg = total / ct; - assert.ok(avg < 2, 'svgedit.utilities.getStrokedBBox average execution time is less than 1 ms'); + assert.isBelow(avg, 2, 'svgedit.utilities.getStrokedBBox average execution time is less than 1 ms'); console.log('Pass2 svgCanvas.getStrokedBBox total ms ' + total + ', ave ms ' + avg.toFixed(1) + ',\t min/max ' + min + ' ' + max); resolve();