mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
25 lines
478 B
JavaScript
25 lines
478 B
JavaScript
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();
|
|
}
|
|
});
|
|
|
|
test("exception in test expression", () => {
|
|
expect(() => {
|
|
while (foo);
|
|
}).toThrow(ReferenceError);
|
|
});
|