• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/5

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

5 Cards in this Set

  • Front
  • Back

In mocha, when does beforeEach runs ?

before each it inside the describe in the scopes bellow (e.g. in all "it" inside the describe it is defined)

How to use the only in Mocha?

only can be used in describe (describe.only) or in a it (it.only). Everything inside the thing that says only will run.



How to use skip in Mocha and why you should us it?

The tests appear with a "-" in front, which means "pending". Skip is used in describe or it. Also this.skip() inside the describe or it should do the same.

In mocha, what things should be at the same level?

Test suits (describe) and spec (it) shouldn't be at the same level. If that is the case, the describes will run after all it has finished.

What is a mock and what is the difference between a mock and stubs?

Mocks are basically stubs with functions to program assertions. With stubs you create the stubs then check spyes and other in assertions. Mocks have the assertions preprogrammed inside it. e.g. mock = sinon.mock(anObject); mock.expects("method").once().withExactArgs("arg1", "arg2") /*some calls in here*/ mock.verify()