Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Which code coverage has boolean sub expressions evaluate to both true and false?

Answer»

Which code COVERAGE has BOOLEAN sub expressions evaluate to both true and false?
CHOOSE the correct option from below list
(1)function coverage
(2)Branch coverage
(3)Statement coverage
(4)predicate coverage

Answer:-(4)predicate coverage

2.

Which among the following is said to have a preprogrammed behavior and as well as preprogrammed expectations?

Answer»

Which among the following is said to have a preprogrammed behavior and as WELL as preprogrammed expectations?
Choose the CORRECT options from below list
(1)stubs
(2)SPIES
(3)mocks
(4)fakes

Answer-(3)mocks

3.

To use Eslint on the machine, node.js is must.

Answer»

To use Eslint on the MACHINE, node.js is must.
Choose the CORRECT option from below list
(1)TRUE
(2)False

Answer:-(1)True

4.

By default Eslint does not have a parser.

Answer»

By default Eslint does not have a parser.
Choose the CORRECT option from below LIST
(1)FALSE
(2)True

Answer:-(1)False

5.

nyc can fail tests if the coverage falls under a threshold using ___________.

Answer»

nyc can fail tests if the COVERAGE FALLS under a threshold using ___________.
Choose the correct OPTION frombelow list
(1)nyc require
(2)nyc MOCHA
(3)nyc check-coverage
(4)nyc report

Answer:-()nyc check-coverage

6.

Which among the following Javascript library is used to bring out lines of code that deviate from coding style guides?

Answer»

Which AMONG the following Javascript library is used to bring out lines of code that DEVIATE from coding STYLE guides?
Choose the correct option from below list
(1)Karma
(2)ESLint
(3)blanket.js
(4)mocha

Answer:-(2)ESLint

7.

Write an example of spy wrapping on existing method

Answer»

Write an example of spy wrapping on EXISTING METHOD
var setNameSpy = sinon.spy(USER, "setName")
is an example of spy wrapping an existing method?
(1)FALSE
(2)True

Answer:-(2)True

8.

Which of the following is a Istanbul plugin that gives support for ES6/ES2015?

Answer»

Which of the following is a Istanbul plugin that gives support for ES6/ES2015?
CHOOSE the correct OPTION from below LIST
(1)tap
(2)chai
(3)babel-plugin-istanbul
(4)nyc

Answer:-(3)babel-plugin-istanbul

9.

Clover is a type of istanbul reporter which output reports in __________ format.

Answer»

Clover is a TYPE of istanbul reporter which output reports in __________ format.
Choose the CORRECT option from list
(1)HTML
(2)txt
(3).xml
(4)JSON

Answer:-(3).xml

10.

By default, Mocha checks unit tests using the path ________

Answer»

By DEFAULT, MOCHA checks unit tests using the path ________
Choose the correct option from below list
(1)Both
(2)./test/*.COFFEE
(3)./test/*.js
(4)None of the options

Answer-(1)Both

11.

Which of the following is an assertion library?

Answer»

Which of the following is an assertion library?
Choose the CORRECT option from below list
(1)sinon
(2)mocha
(3)nyc
(4)chai

Answer-(4)chai

12.

Which of the following is the ECMA 7 feature that allows promises without sending callback to .then and instead the value will be returned by the asyn

Answer»

Which of the FOLLOWING is the ECMA 7 feature that allows PROMISES WITHOUT sending CALLBACK to .then and instead the value will be returned by the asynchrnous function?
Please select the correct option from below list
(1)finally()
(2)Chai-as-promised
(3)Async/Await
(4)done()

Answer:-(3)Async/Await

13.

Which of the following is not a javascript linter?

Answer»

Which of the following is not a javascript linter?
Choose the CORRECT OPTION from below list
(1)JsHint
(2)ESLINT
(3)lint4j
(4)Jslint

Answer:-(3)lint4j

14.

________ are fake methods with pre-programmed behaviour and pre-programmed expectation.

Answer»

________ are fake methods with pre-programmed behaviour and pre-programmed expectation.
Choose the correct option from below LIST
(1)Fakes
(2)MOCKS
(3)Spies
(4)Stubs

Answer:-(2)Mocks

15.

stub.yields() is used to call the first callback when anyargument is passed to it.

Answer»

stub.yields() is used to call the FIRST callback when anyargument is passed to it.
Choose the CORRECT option from below LIST
(1)True
(2)False

Answer:-(1)True

16.

Which of the chai assertion styles do not work in Internet Explorer?

Answer»

Which of the chai assertion styles do not WORK in Internet Explorer?
CHOOSE the correct option from below list
(1)spie
(2)should
(3)EXPECT
(4)assert

Answer:-(2)should

17.

Which of the following is the ECMA 7 feature that allows promises without sending callback to.

Answer»

Which of the following is the ECMA 7 feature that allows promises without SENDING CALLBACK to.
then and instead the value will be returned by the asynchronous function?
CHOOSE the correct answer from below list
(1)done()
(2)Chai-as-promised
(3)finally()
(4)Async/Await

Answer:-(4)Async/Await

18.

Which type of testing involves testing the individual functions or classes by mocking input and making sure the output is as expected?

Answer»

Which type of testing involves testing the individual functions or CLASSES by mocking input and making sure the output is as expected?
Choose the CORRECT option from below list
(1)mocha
(2)integration testing
(3)unit testing
(4)functional testing

Answer:-(3)unit testing

19.

Which of the following is the unit testing functionality that spawns a webserver and runs source code against test code for configured browsers?

Answer»

Which of the following is the UNIT testing functionality that spawns a webserver and runs source code against test code for configured BROWSERS?
Choose the correct option from below LIST
(1)sinon
(2)CHAI
(3)karma
(4)mocha

Answer:-(3)karma

20.

Which among the following test double is used to replace a target function with pre-programmed method directing to specific path?

Answer»

Which among the following test double is USED to replace a TARGET function with pre PROGRAMMED method directing to specific path?
Choose the correct option from below LIST
(1)Mocks
(2)Stub
(3)SPIE
(4)Dummies

Answer:-(2)Stub

21.

Mocks have built-in assertions.

Answer» MOCKS have BUILT in assertions.
Choose the correct option from below LIST
(1)True
(2)False

Answer:-(1)True
22.

___________ are specified using -formatter or -f on command line.

Answer»

___________ are specified using formatter or F on COMMAND line.
Choose the correct option from below list
(1)turn on a rule
(2)FORMATTERS
(3)configurations
(4)globals

Answer:-(2)Formatters

23.

What is the Testdouble that are fake methods with preprogrammed behavior and expectation?

Answer»

What is the Testdouble that are FAKE methods with preprogrammed BEHAVIOR and EXPECTATION?
Choose the correct option from below list
(1)MOCKS
(2)Stubs
(3)Dummies
(4)Fakes

Answer:-(1)Mocks

24.

When spying an original function we need to restore the original function using __________.

Answer»

When spying an original function we need to restore the original function USING __________.
Choose the CORRECT option from below list
(1)sinon.spy()
(2)object.method.restore
(3)sinon.spy(obj,'method')
(4)sinon.stub()

Answer:-(2)object.method.restore

25.

Which among the following is said to have a preprogrammed behavior?

Answer»

Which among the FOLLOWING is SAID to have a preprogrammed behavior?
Choose the correct OPTION from below LIST
(1)fakes
(2)spies
(3)mocks
(4)stubs

Answer:-(4)stubs

26.

Assertion library does the actual verification of the test results.

Answer» ASSERTION library does the actual verification of the test results.
Choose the CORRECT option from below LIST
(1)False
(2)TRUE

Answer:-(2)True
27.

Which of the following test double is used to record function calls, arguments and exceptions thrown?

Answer»

Which of the FOLLOWING test double is used to record function CALLS, arguments and exceptions THROWN?
CHOOSE the correct ANSWER from below list
(1)Dummies
(2)Spies
(3)Mocks
(3)Fakes

Answer:-(2)Spies

28.

Istanbul uses ___________ JavaScript parser for generating measured version of code.

Answer»

Istanbul uses ___________ JavaScript parser for generating measured version of code.
Choose the CORRECT option from below list
(1)Esprima
(2)acorn
(3)CANOPY
(4)PEG

Answer:-(1)Esprima

29.

Lambdas lexically bind _______ and cannot access the mocha content. So passing arrow functions in Mocha is discouraged.

Answer»

Lambdas lexically BIND _______ and cannot ACCESS the mocha content. So passing arrow FUNCTIONS in Mocha is discouraged.
Choose the correct option from below list
(1)then
(2)it()
(3)DESCRIBE()
(4)None of the options

Answer:-(1)then

30.

Is the following unit testing an asynchronous code is valid?

Answer»

Is the following unit testing an asynchronous code is VALID?
it("Using setTimeout() to SIMULATE ASYNC code!",
function(done){ setTimeout(function() { console.log("Test"); }, 200); });
Choose the correct option from below LIST
(1)Invalid
(2)Valid

Answer:-(1)Invalid

31.

What happens if an error is thrown inside 'then'?

Answer»

What happens if an ERROR is thrown inside then?
Choose the correct option from below list
(1)MOCHA never HEARS about the error
(2)All the options
(3)The error will be swallowed by promise
(4)Throws a timeout after WAITING for a while

Answer:-(2)All the options

32.

What is default style of interface of Mocha framework?

Answer»

What is default STYLE of interface of MOCHA framework?
Choose the correct option from below list
(1)Both
(2)TDD
(3)BDD
(4)NONE of the options

Answer-(3)BDD

33.

Which of the following is a headless browser that runs on running Javascript?

Answer»

Which of the following is a headless browser that runs on RUNNING Javascript?
Choose the correct OPTION from below list
(1)ChromeCanary
(2)PHANTOMJS
(3)Protractor
(4)Casper

Answer:-(2)PhantomJS

34.

Each unit test should test one concern only.

Answer»

Each UNIT test should test ONE concern only.
Choose the correct answer from below list
(1)TRUE
(2)False

Answer:-(1)True

35.

In Eslint, linting rules can be turned on or off using javascript comments embedding configuration rules.

Answer»

In Eslint, LINTING rules can be TURNED on or off using javascript COMMENTS embedding configuration rules.
Choose the CORRECT answer from below LIST
(1)True
(2)False

Answer:-(1)True

36.

The Mocha hook that runs first before executing any tests in a describe() block is ___________.

Answer»

The MOCHA hook that runs first before executing any tests in a DESCRIBE() BLOCK is ___________.
CHOOSE the correct option from list
(1)afterEach()
(2)after()
(3)beforeEach()
(4)before()

Answer:-(4)before()