v1
4/14/2021 by victor-homyakov -00
Setup HTML - click to add setup HTML
disable setup JavaScript
Setup JavaScript
const json = JSON.stringify({
	time: 'placeholder',
	data_a: [11, 22, 33, 44, 55, 66, 77, 88, 99],
	data_s: 'some text',
	data_n: 1.23456789,
	links: {
	    first: 'http://www.example.com/query?first',
	    next: 'http://www.example.com/query?next',
	    prev: 'http://www.example.com/query?prev',
	    last: 'http://www.example.com/query?last'
	}
});

function sameJson() {
	return json.replace('placeholder', '123456789');
}

function uniqJson() {
	return json.replace('placeholder', '' + Date.now());
}

let result = 0;

function countKeys(obj) {
	result += Object.keys(obj).length;
}

function parse1(str) {
    countKeys(JSON.parse(str));
}

function parse2(str) {
    countKeys((new Function('return ' + str))());
}

delete caserun single casemove downdrag and drop case


ready



parse1(sameJson());
delete caserun single casemove upmove downdrag and drop case


ready



parse2(sameJson());
delete caserun single casemove upmove downdrag and drop case


ready



parse1(uniqJson());
delete caserun single casemove updrag and drop case


ready



parse2(uniqJson());
Test Case - click to add another test case
disable teardown JavaScript
teardown JavaScript
console.log(result);
Output (DOM) - click to monitor output (DOM) while test is running
RUN