300+ Top Jasmine.js MCQ Questions and Answers Quiz

Jasmine.js Multiple Choice Questions

1. Which architecture does Jasmine.js follows?

  1. MVM
  2. BDD
  3. MVVM
  4. MVP

Answer: B BDD

Explanation: Behaviour-driven development architecture does Jasmine.js follows.

2. A ____ is a set of related type test cases developed for a given file or function.

  1. Groups
  2. Cluster
  3. Suite
  4. Collection

Answer: C Suite

Explanation: A suite is a set of related type test cases developed for a given file or function.

3. Which of the following method is used to define suites?

  1. Define
  2. Suits
  3. Test
  4. Describe

Answer: D Describe

Explanation: Describe method is used to define suites.

4. How many arguments does Describe function take?

  1. 2
  2. 3
  3. 4
  4. 5

Answer: A 2

Explanation: Describe function takes two arguments: a text that describes the collection of tests, and a function that includes the tests.

5. What is Jasmine.js?

  1. JavaScript testing framework
  2. JavaScript mobile development framework
  3. JavaScript web development framework

Answer: A JavaScript testing framework

Explanation: Jasmine.js is a JavaScript testing framework.

6. Is Jasmine.js open-source?

  1. Yes
  2. No

Answer: A Yes

Explanation: Yes, Jasmine.js is an open-source framework.

7. Does Jasmine.js requires DOM?

  1. Yes
  2. No

Answer: B No

Explanation: Jasmine.js does not require any DOM.

8. The ____ block is a single test defined with its method.

  1. Nested Suites block
  2. Describe Block
  3. IT block
  4. Expect block

Answer: C IT block

Explanation: The “it” block is a single test defined by its method.

9. ____ is also known as a matcher.

  1. Nested Suites block
  2. Describe Block
  3. IT block
  4. Expect block

Answer: D Expect block

Explanation: Expect block is also known as a matcher.

10. Mainly how many types of matchers does Jasmine provides?

  1. 5
  2. 4
  3. 3
  4. 2

Answer: D 2

Explanation: 2 types of matchers Jasmine provides: Inbuilt and user-defined.

Jasmine.js MCQs

11. Which of the following is an inbuilt matcher?

  1. toBe
  2. toEqual
  3. toBeNull
  4. All of the above

Answer: D All of the above

Explanation: Following are the inbuilt matchers:

  • toBe
  • toEqual
  • toBeNull

12. User-defined matcher needs to be defined ____.

  1. Implicitly
  2. Explicitly
  3. Both

Answer: B Explicitly

Explanation: Custom matcher needs to be defined explicitly().

13. Which of the following inbuilt matcher just compares if the outcome of the operation sent as an argument to this method matches or not?

  1. Equal ()
  2. toMatch ()
  3. toEqual ()

Answer: C toEqual ()

Explanation: toEqual () just compares if the outcome of the operation sent as an argument to this method matches or not.

14. Which of the following inbuilt matcher is used to determine whether a value does not match the output of any function?

  1. NotEqual ()
  2. nottoMatch ()
  3. toEqual ()
  4. Not.toEqual()

Answer: D Not.toEqual()

Explanation: Not.toEqual () is used to determine whether a value does not match the output of any function.

15. In Jasmine, which of the following Boolean matcher is used to determine if the result is true or false?

  1. toBeTruthy()
  2. toTruthy():
  3. CheckTruthy():

Answer: A toBeTruthy()

Explanation: toBeTruthy() Boolean matcher is used to determine if the result is true or false.

16. Among toBe () and toEqual () which of the following compares objects recursively and checks property equality, and it is type sensitive.

  1. toBe ()
  2. toEqual ()

Answer: B toEqual ()

Explanation: toEqual () compares objects recursively and checks property equality, and it is type sensitive.

17. ____ matchers allow us to determine whether an element belongs to the same array or another sequential object.

  1. Tocheck ()
  2. toMatch()
  3. toContain()

Answer: C toContain()

Explanation: toContain() matchers allow us to determine whether an element belongs to the same array or another sequential object.

18. Suppose you want to Check to see whether any variables in the code are predefined, then which of the following matcher you will use?

  1. TobePredefined ()
  2. toBeDefined
  3. ToPredefined()

Answer: B toBeDefined

Explanation: toBeDefined () Check to see whether any variables in the code are predefined.

19. ____ matcher helps to check null values?

  1. ToNull()
  2. Null()
  3. toBeNull()

Answer: C toBeNull()

Explanation: toBeNull () matcher helps to check null values.

20. When we are unsure about the output, we employ the special matcher named as ____.

  1. Any
  2. All
  3. Some
  4. None

Answer: A Any

Explanation: When we are unsure about the output, we employ the special matcher any.

21. How many Spying technologies are available in Jasmine?

  1. 5
  2. 4
  3. 3
  4. 2

Answer: D 2

Explanation: There are two types of spying technology available in Jasmine: SpyOn() and CreateSpy().

22. ____ is a feature integrated into the Jasmine framework that allows you to spy on a specific section of code.

  1. SpyOn()
  2. Spy ()
  3. CreateSpy ()

Answer: A SpyOn()

Explanation: SpyOn() is a feature integrated into the Jasmine framework that allows you to spy on a specific section of code.

23. Which of the following command manages the Jasmine Clock, which may be used to regulate the flow of time in your tests?

  1. Clock ()
  2. toBeClock ()
  3. Jasmine.Clock()

Answer: C Jasmine.Clock()

Explanation: Jasmine.Clock () command manages the Jasmine Clock, which may be used to regulate the flow of time in your tests.

24. ____ check to see whether any variables were previously undefined.

  1. toBeNotDefined ()
  2. toUndefined()
  3. toBeUndefined ()

Answer: C toBeUndefined ()

Explanation: toBeUndefined () check to see whether any variables were previously undefined.

25. When jasmine.js was released?

  1. 2001
  2. 2019
  3. 2010
  4. 2000

Answer: C 2010

Explanation: In 2010 jasmine.js was released.

26. It() is global function or a Local function?

  1. Global
  2. Local

Answer: A Global

Explanation: it() function is a global function.

27. Which of the following companies uses Jasmine?

  1. Accenture.
  2. Walmart.
  3. E-Commerce.
  4. GitLab.
  5. All of the above

Answer: E) All of the above

Explanation: Following companies use Jasmine:

  • Accenture.
  • Walmart.
  • E-Commerce.
  • GitLab.

28. Is toBeTruthy () and toBeFalsy the same?

  1. Yes
  2. No

Answer: B No

Explanation: toBeFalsy matches the output to be false whereas toBeTruthy matches the output to be true.

29. After each test specification has been executed, ____ method is invoked

  1. Each ()
  2. AfterEach ()
  3. EachAfter()

Answer: B AfterEach ()

Explanation: After each test specification has been executed, afterEach() method is invoked.

30. Which of the following are the alternative to Jasmine.js?

  1. Mocha
  2. Jest
  3. Tape
  4. All of the above

Answer: D All of the above

Explanation: Following are the alternatives of Jasmine.js:

  • Mocha
  • Jest
  • Tape

Jasmine.js objective questions with answers pdf download online certification exam test

Leave a Reply

Your email address will not be published. Required fields are marked *