rwwagner90/ember-math-helpers

View on GitHub
test-app/tests/unit/helpers/sqrt-test.js

Summary

Maintainability
A
0 mins
Test Coverage
import { sqrt } from 'ember-math-helpers/helpers/sqrt';
import { module, test } from 'qunit';

module('Unit | Helper | sqrt', function () {
  test('square root works', function (assert) {
    const result = sqrt([25]);
    assert.strictEqual(result, 5);
  });

  test('negative square root is NaN', function (assert) {
    const result = sqrt([-10]);
    assert.ok(isNaN(result));
  });
});