Branch data Line data Source code
1 [ + ]: 1 : import assert from 'node:assert/strict'; 2 : 1 : import { FormData } from '../../../../lib/whatwg-xhr.js'; 3 : 1 : 4 [ + ]: 1 : export default (activeURL) => { 5 : 1 : 6 : 1 : assert.throws( 7 [ + ]: 1 : () => { 8 : 1 : new FormData(null); 9 : 1 : }, 10 [ + ]: 1 : (err) => { 11 : 1 : assert(err instanceof TypeError, 'TypeError expected'); 12 : 1 : return true; 13 : 1 : } 14 : 1 : ); 15 : 1 : 16 : 1 : assert.throws( 17 [ + ]: 1 : () => { 18 : 1 : new FormData('string'); 19 : 1 : }, 20 [ + ]: 1 : (err) => { 21 : 1 : assert(err instanceof TypeError, 'TypeError expected'); 22 : 1 : return true; 23 : 1 : } 24 : 1 : ); 25 : 1 : } 26 : 1 : 27 : 1 : /* 28 : 1 : * constructor.any.js 29 : 1 : * 30 : 1 : 31 : 1 : // META: title=FormData: constructor 32 : 1 : 33 : 1 : test(() => { 34 : 1 : assert_throws_js(TypeError, () => { new FormData(null); }); 35 : 1 : assert_throws_js(TypeError, () => { new FormData("string"); }); 36 : 1 : }, "Constructors should throw a type error"); 37 : 1 : 38 : 1 : * 39 : 1 : * 40 : 1 : */