mirror of
https://github.com/morluto/rea.git
synced 2026-11-11 01:13:39 +00:00
test: consolidate JavaScript and provider fixture coverage
This commit is contained in:
1 parent
439c197c3f
commit
3c4be703cd
16 files changed
+23
-223
No files matched your search
@@ -73,24 +73,4 @@ describe("JavaScript semantic analysis: logical assignment", () => {
|
||||
"unknown",
|
||||
);
|
||||
});
|
||||
|
||||
it("reproduces the issue #2646 inputs without an exact literal", () => {
|
||||
for (const operator of ["||=", "??="]) {
|
||||
const { binding, returned } = observe(
|
||||
`function read(x) { x ${operator} 2; return x; }`,
|
||||
);
|
||||
expect(binding).not.toEqual({ status: "literal", value: 2 });
|
||||
expect(returned).not.toEqual({ status: "literal", value: 2 });
|
||||
}
|
||||
const readOr = (x: number) => {
|
||||
x ||= 2;
|
||||
return x;
|
||||
};
|
||||
const readNullish = (x: number) => {
|
||||
x ??= 2;
|
||||
return x;
|
||||
};
|
||||
expect(readOr(5)).toBe(5);
|
||||
expect(readNullish(5)).toBe(5);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user