rwwagner90/ember-math-helpers

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

Summary

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

module('Unit | Helper | pow', function () {
  test('pow works', function (assert) {
    const result = pow([7, 2]);
    assert.strictEqual(result, 49);
  });

  test('negative base works', function (assert) {
    const result = pow([-7, 2]);
    assert.strictEqual(result, 49);
  });

  test('negative exponent works', function (assert) {
    const result = pow([2, -2]);
    assert.strictEqual(result, 0.25);
  });
});