A test has a dependency on database. query. During the test, the dependency is replaced
with an object called database with the method,
Calculator query, that returns an array. The developer does not need to verify how many
times the method has been called.
Which two test approaches describe the requirement?
Choose 2 answers
A.
White box
B.
Stubbing
C.
Black box
D.
ubstitution
White box
ubstitution
A Developer wrote the following code to test a sum3 function that takes in an array of
numbers and returns the sum of the first three number in the array, The test passes:
Let res = sum2([1, 2, 3 ]) ;
console.assert(res === 6 );
Res = sum3([ 1, 2, 3, 4]);
console.assert(res=== 6);
A different developer made changes to the behavior of sum3 to instead sum all of the
numbers
present in the array. The test passes:
Which two results occur when running the test on the updated sum3 function ?
Choose 2 answers
A.
The line 02 assertion passes.
B.
The line 02 assertion fails
C.
The line 05 assertion passes.
D.
The line 05 assertion fails.
The line 02 assertion passes.
The line 05 assertion fails.
Refer to the code below:
01 const exec = (item, delay) =>{
02 new Promise(resolve => setTimeout( () => resolve(item), delay)),
03 async function runParallel() {
04 Const (result1, result2, result3) = await Promise.all{
05 [exec (‘x’, ‘100’) , exec(‘y’, 500), exec(‘z’, ‘100’)]
06 );
07 return `parallel is done: $(result1) $(result2)$(result3)`;
08 }
}
}
Which two statements correctly execute the runParallel () function?
Choose 2 answers
A.
Async runParallel () .then(data);
B.
runParallel ( ). done(function(data){
return data;
});
C.
runParallel () .then(data);
D.
runParallel () .then(function(data)
return data
runParallel ( ). done(function(data){
return data;
});
runParallel () .then(function(data)
return data
A developer has the following array of student test grades:
Let arr = [ 7, 8, 5, 8, 9 ];
The Teacher wants to double each score and then see an array of the students
who scored more than 15 points.
How should the developer implement the request?
A.
Let arr1 = arr.filter(( val) => ( return val > 15 )) .map (( num) => ( return num *2 ))
B.
Let arr1 = arr.mapBy (( num) => ( return num *2 )) .filterBy (( val ) => return val > 15 )) ;
C.
Let arr1 = arr.map((num) => num*2). Filter (( val) => val > 15);
D.
Let arr1 = arr.map((num) => ( num *2)).filterBy((val) => ( val >15 ));
Let arr1 = arr.map((num) => num*2). Filter (( val) => val > 15);
Given the code below:
const copy = JSON.stringify([ new String(‘ false ’), new Bollean( false ), undefined ]);
What is the value of copy?
A.
-- [ \”false\” , { } ]--
B.
-- [ false, { } ]--
C.
-- [ \”false\” , false, undefined ]--
D.
- [ \”false\” ,false, null ]--
- [ \”false\” ,false, null ]--
Page 5 out of 45 Pages |
Previous |