github.com/sl1pm4t/consul@v1.4.5-0.20190325224627-74c31c540f9c/ui-v2/tests/unit/utils/btoa-test.js (about) 1 import { module } from 'ember-qunit'; 2 import test from 'ember-sinon-qunit/test-support/test'; 3 import btoa from 'consul-ui/utils/btoa'; 4 module('Unit | Utils | btoa', {}); 5 6 test('it encodes strings properly', function(assert) { 7 [ 8 { 9 test: '', 10 expected: '', 11 }, 12 { 13 test: '1234', 14 expected: 'MTIzNA==', 15 }, 16 ].forEach(function(item) { 17 const actual = btoa(item.test); 18 assert.equal(actual, item.expected); 19 }); 20 });