rwwagner90/ember-math-helpers

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

Summary

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

module('Unit | Helper | sign', function () {
  test('it works', function (assert) {
    assert.strictEqual(sign([-5]), -1, 'Negative returns -1');

    assert.strictEqual(sign([5]), 1, 'Positive returns 1');

    assert.strictEqual(String(sign(['foo'])), 'NaN', 'Invalid returns NaN');
  });
});