Skip to content

Commit

Permalink
Merge pull request #12528 from timvandermeij/test-unit-no-var
Browse files Browse the repository at this point in the history
Convert `var` to `const`/`let` in the `test/unit` folder
  • Loading branch information
timvandermeij authored Oct 25, 2020
2 parents b4ca3d5 + fe08ef4 commit 2251677
Show file tree
Hide file tree
Showing 18 changed files with 878 additions and 816 deletions.
10 changes: 10 additions & 0 deletions test/unit/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": [
"../.eslintrc"
],

"rules": {
// ECMAScript 6
"no-var": "error",
},
}
273 changes: 148 additions & 125 deletions test/unit/api_spec.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions test/unit/bidi_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ import { bidi } from "../../src/core/bidi.js";
describe("bidi", function () {
it("should mark text as RTL if more than 30% of text is RTL", function () {
// 33% of test text are RTL characters
var test = "\u0645\u0635\u0631 Egypt";
var result = "Egypt \u0631\u0635\u0645";
var bidiText = bidi(test, -1, false);
const test = "\u0645\u0635\u0631 Egypt";
const result = "Egypt \u0631\u0635\u0645";
const bidiText = bidi(test, -1, false);

expect(bidiText.str).toEqual(result);
expect(bidiText.dir).toEqual("rtl");
});

it("should mark text as LTR if less than 30% of text is RTL", function () {
var test = "Egypt is known as \u0645\u0635\u0631 in Arabic.";
var result = "Egypt is known as \u0631\u0635\u0645 in Arabic.";
var bidiText = bidi(test, -1, false);
const test = "Egypt is known as \u0645\u0635\u0631 in Arabic.";
const result = "Egypt is known as \u0631\u0635\u0645 in Arabic.";
const bidiText = bidi(test, -1, false);

expect(bidiText.str).toEqual(result);
expect(bidiText.dir).toEqual("ltr");
Expand Down
Loading

0 comments on commit 2251677

Please sign in to comment.