mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:08:12 +00:00
LibJS: Add tests for symbol object integration
This commit is contained in:
parent
7a1d485b19
commit
119386ffb0
13 changed files with 198 additions and 13 deletions
|
@ -18,6 +18,8 @@ test("name", () => {
|
|||
});
|
||||
|
||||
test("extended name syntax", () => {
|
||||
const s = Symbol("foo");
|
||||
|
||||
class A {
|
||||
get "method with space"() {
|
||||
return 1;
|
||||
|
@ -30,12 +32,17 @@ test("extended name syntax", () => {
|
|||
get [`he${"llo"}`]() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
get [s]() {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
const a = new A();
|
||||
expect(a["method with space"]).toBe(1);
|
||||
expect(a[12]).toBe(2);
|
||||
expect(a.hello).toBe(3);
|
||||
expect(a[s]).toBe(4);
|
||||
});
|
||||
|
||||
test("inherited getter", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue