summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Tests/loops/while-basic.js
blob: cd1ded3e13f916a1a53d9e4f832751f736699fe8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
test("basic functionality", () => {
  let number = 0;
  while (number < 9) {
    number++;
  }
  expect(number).toBe(9);
});

test("no braces", () => {
  let number = 0;
  while (number < 3) number++;
  expect(number).toBe(3);
});

test("does not loop when initially false", () => {
  while (false) {
    expect().fail();
  }
});