summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Tests/const-declaration-missing-initializer.js
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibJS/Tests/const-declaration-missing-initializer.js')
-rw-r--r--Userland/Libraries/LibJS/Tests/const-declaration-missing-initializer.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Tests/const-declaration-missing-initializer.js b/Userland/Libraries/LibJS/Tests/const-declaration-missing-initializer.js
new file mode 100644
index 0000000000..5bbf2ef9e2
--- /dev/null
+++ b/Userland/Libraries/LibJS/Tests/const-declaration-missing-initializer.js
@@ -0,0 +1,5 @@
+test("missing initializer in 'const' variable declaration is syntax error", () => {
+ expect("const foo").not.toEval();
+ expect("const foo = 1, bar").not.toEval();
+ expect("const foo = 1, bar, baz = 2").not.toEval();
+});