index.spec.js 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. import { upperCase, localeUpperCase } from ".";
  2. var TEST_CASES = [
  3. ["", ""],
  4. ["test", "TEST"],
  5. ["test string", "TEST STRING"],
  6. ["Test String", "TEST STRING"],
  7. ["\u0131", "I"],
  8. ];
  9. var LOCALE_TEST_CASES = [["i", "\u0130", "tr"]];
  10. describe("upper case", function () {
  11. var _loop_1 = function (input, result) {
  12. it(input + " -> " + result, function () {
  13. expect(upperCase(input)).toEqual(result);
  14. });
  15. };
  16. for (var _i = 0, TEST_CASES_1 = TEST_CASES; _i < TEST_CASES_1.length; _i++) {
  17. var _a = TEST_CASES_1[_i], input = _a[0], result = _a[1];
  18. _loop_1(input, result);
  19. }
  20. });
  21. describe("locale upper case", function () {
  22. var _loop_2 = function (input, result, locale) {
  23. it(locale + ": " + input + " -> " + result, function () {
  24. expect(localeUpperCase(input, locale)).toEqual(result);
  25. });
  26. };
  27. for (var _i = 0, LOCALE_TEST_CASES_1 = LOCALE_TEST_CASES; _i < LOCALE_TEST_CASES_1.length; _i++) {
  28. var _a = LOCALE_TEST_CASES_1[_i], input = _a[0], result = _a[1], locale = _a[2];
  29. _loop_2(input, result, locale);
  30. }
  31. });
  32. //# sourceMappingURL=index.spec.js.map