mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 22:02:44 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			23 lines
		
	
	
	
		
			848 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
	
		
			848 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| "use strict";
 | |
| 
 | |
| test.xfail("basic functionality", () => {
 | |
|     [true, false, "foo", 123].forEach(primitive => {
 | |
|         expect(() => {
 | |
|             primitive.foo = "bar";
 | |
|         }).toThrowWithMessage(TypeError, `Cannot set property 'foo' of ${primitive}`);
 | |
|         expect(() => {
 | |
|             primitive[Symbol.hasInstance] = 123;
 | |
|         }).toThrowWithMessage(
 | |
|             TypeError,
 | |
|             `Cannot set property 'Symbol(Symbol.hasInstance)' of ${primitive}`
 | |
|         );
 | |
|     });
 | |
|     [null, undefined].forEach(primitive => {
 | |
|         expect(() => {
 | |
|             primitive.foo = "bar";
 | |
|         }).toThrowWithMessage(TypeError, `${primitive} cannot be converted to an object`);
 | |
|         expect(() => {
 | |
|             primitive[Symbol.hasInstance] = 123;
 | |
|         }).toThrowWithMessage(TypeError, `${primitive} cannot be converted to an object`);
 | |
|     });
 | |
| });
 | 
