mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 17:52:45 +00:00 
			
		
		
		
	 d40331ef69
			
		
	
	
		d40331ef69
		
	
	
	
	
		
			
			This commit adds the ShadowRealm object itself, its constructor, and prototype (currently empty).
		
			
				
	
	
		
			20 lines
		
	
	
	
		
			633 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
	
		
			633 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| describe("errors", () => {
 | |
|     test("called without new", () => {
 | |
|         expect(() => {
 | |
|             ShadowRealm();
 | |
|         }).toThrowWithMessage(TypeError, "ShadowRealm constructor must be called with 'new'");
 | |
|     });
 | |
| });
 | |
| 
 | |
| describe("normal behavior", () => {
 | |
|     test("length is 0", () => {
 | |
|         expect(ShadowRealm).toHaveLength(0);
 | |
|     });
 | |
| 
 | |
|     test("basic functionality", () => {
 | |
|         const shadowRealm = new ShadowRealm();
 | |
|         expect(typeof shadowRealm).toBe("object");
 | |
|         expect(shadowRealm).toBeInstanceOf(ShadowRealm);
 | |
|         expect(Object.getPrototypeOf(shadowRealm)).toBe(ShadowRealm.prototype);
 | |
|     });
 | |
| });
 |