What I Saw in Syria by Declan Walsh

This article is about Declan Walsh, a reporter from New York Times, painted a visual story for us to have a peak at Syria's reality during war time in April, 2019. Syria was suffering from countless…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Skip Tests in Mocha

Dynamically skip JavaScript tests at runtime with Mocha

One of the most common actions when writing or debugging tests, regardless of the framework used, is being able to ignore some tests.
That is especially true if you practice TDD, or tend to first list the placeholders for the tests you plan to write.

Another quick option is prepending x to the it or the describe:

In some situations, you’ll need to skip tests dynamically.
Example of such might be when the test depends on the running environment.

In this case use this.skip()

Do not execute any action after calling this.skip(), as the call will abort the test.

You can skip all tests in a describe block — including all it, beforeEach/ afterEach, and describe blocks within the suite - by using this.skip() in a before hook

Skip Tests Meme

You can run just a specific suite or test-case by appending .only() to the function.

Add a comment

Related posts:

The Benefits and Perils of Price Differentiation

Price differentiation — that is, setting different prices for different customers — is typically positioned as one of the silver bullets in the arsenal of the pricing manager. In this blog, we will…

The Two Great Assets You Need to Reach Every Dream

Becoming the kind of person you envisioned yourself to be and successful in today’s world isn’t an easy task — no playing of words around this. It takes certain factors to make that happen aside…

How to Buy Quality Traffic for Website

A website is vital in today’s digital world for both organizations and individuals. However, simply having a website does not ensure success. To attract visitors and potential customers, you need…