A caff mocha (Arabic: موكا) (/ˈmɒkə/ or /ˈmoʊkə/), also called mocaccino (.mw-parser-output .IPA-label-smallfont-size:85%.mw-parser-output .references .IPA-label-small,.mw-parser-output .infobox .IPA-label-small,.mw-parser-output .navbox .IPA-label-smallfont-size:100%Italian: [mokatˈtʃiːno]), is a chocolate-flavoured warm beverage that is a variant of a caff latte (Italian: [kafˈfɛ lˈlatte]),[1] commonly served in a glass rather than a mug. Other commonly used spellings are mochaccino[2] and also mochachino. The name is derived from the city of Mokha, Taiz Governorate, Yemen, which was one of the centres of early coffee trade.[3] Like latte, the name is commonly shortened to just mocha.
The name "mocha" is derived from the Yemeni port of Mokha, which was a port well-known for its coffee trade from the 15th to 17th century,[4] and where small quantities of fine coffee grown in the hills nearby was exported.[5] When coffee drinking culture spread to Europe, Europeans referred to coffee imports from Arabia as Mochas, even though coffee from Yemen itself was uncommon and frequently mixed with beans from Abyssinia, and later coffee from Malabar or the West Indies were also marketed as Mocha coffee.[5][6]
The drink nowadays called "mocha", however, has chocolate in it, and some believe that this is the result of confusion caused by the chocolatey tone that may sometimes be found in Yemeni coffee.[7] Chocolate has been combined with coffee after chocolate drink was introduced to Italy in the 17th century; in Turin, chocolate was mixed with coffee and cream to produce bavareisa, which evolved in the 18th century into bicerin served in small clear glass where its components may be observed as three separate layers.[8] However, prior to 1900s, Mocha referred to Yemeni coffee, and its meaning began to change around the turn of the 20th century, and recipes for food such as cakes that combined chocolate and coffee that referenced mocha began to appear. In 1920, a recipe for a "Chilled Mocha" was published with milk, coffee and cocoa as ingredients.[7]
Like caff latte, caff mocha is based on espresso and hot milk but with added chocolate flavouring and sweetener, typically in the form of cocoa powder and sugar. Many varieties use chocolate syrup instead, and some may contain dark or milk chocolate.
Caff mocha, in its most basic formulation, can also be referred to as hot chocolate with (e.g., a shot of) espresso added. Like cappuccino, caff mochas typically contain the distinctive milk froth on top; as is common with hot chocolate, they are sometimes served with whipped cream instead. They are usually topped with a dusting of either cinnamon, sugar or cocoa powder, and marshmallows may also be added on top for flavour and decoration.[9]
A variant is white caff mocha, made with white chocolate instead of milk or dark.[10] There are also variants of the drink that mix the two syrups; this mixture is referred to by several names, including black-and-white mocha, marble mocha, tan mocha, tuxedo mocha, and zebra mocha.
Another variant is a mochaccino which is an espresso shot (double) with either a combination of steamed milk and cocoa powder or chocolate milk. Both mochaccinos and caff mocha can have chocolate syrup, whipped cream and added toppings such as cinnamon, nutmeg or chocolate sprinkles.[11] French White Mocha is another name for Mochaccino, without cinnamon powder.
A third variant on the caff mocha is to use a coffee base instead of espresso. The combination would then be coffee, steamed milk, and the added chocolate. This is the same as a cup of coffee mixed with hot chocolate. The caffeine content of this variation would then be equivalent to the coffee choice included.
Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple and fun. Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases. Hosted on GitHub.
By adding an argument (usually named done) to it() to a test callback, Mocha will know that it should wait for this function to be called to complete the test. This callback accepts both an Error instance (or subclass thereof) or a falsy value; anything else is invalid usage and throws an error (usually causing a failed test).
If you need to perform asynchronous operations before any of your suites are run (e.g. for dynamically generating tests), you may delay the root suite. Run mocha with the --delay flag. This will attach a special callback function, run(), to the global context:
Previous to v3.0.0, .only() used string matching to decide which tests to execute; this is no longer the case. In v3.0.0 or newer, .only() can be used multiple times to define a subset of tests to run:
Be mindful not to commit usages of .only() to version control, unless you really mean it! To do so one can run mocha with the option --forbid-only in the continuous integration test command (or in a git precommit hook).
In v3.0.0 or newer, a parameter passed to this.timeout() greater than the maximum delay value will cause the timeout to be disabled. In v8.0.0 or newer, this.enableTimeouts() has been removed. Warning: With async tests if you disable timeouts via this.timeout(0) and then do not call done(), your test will exit silently.
By default, Mocha will attempt to trap uncaught exceptions thrown from running tests and report these as test failures. Use --allow-uncaught to disable this behavior and allow uncaught exceptions to propagate. Will typically cause the process to crash.
Use this option to have Mocha check for global variables that are leaked while running tests. Specify globals that are acceptable via the --global option (for example: --check-leaks --global jQuery --global MyLib).
For Node.js and V8 options. Mocha forwards these options to Node.js by spawning a new child-process.
The options are set without leading dashes --, e.g. -n require=foo -n unhandled-rejections=strict
By default, Mocha looks for a package.json in the current working directory or nearest ancestor, and will use the first file found (regardless of whether it contains a mocha property); to suppress package.json lookup, use --no-package.
To exclude all files in a directory it is preferable to use foo/bar instead of foo/bar/**/*. The latter will still watch the directory foo/bar but will ignore all changes to the content of that directory.
You cannot use it.only, describe.only, this.only(), etc., in parallel mode. This is for the same reason as the incompatible reporters noted above: in parallel mode, Mocha does not load all files and suites into memory before running tests.
Running tests in parallel mode will naturally use more system resources. The OS may take extra time to schedule and complete some operations, depending on system load. For this reason, the timeouts of individual tests may need to be increased either globally or otherwise.
When Mocha runs in parallel mode, test files do not share the same process, nor do they share the same instance of Mocha. Consequently, a hypothetical root hook defined in test file A will not be present in test file B.
Third-party reporters may encounter issues when attempting to access non-existent properties within Test, Suite, and Hook objects. If a third-party reporter does not work in parallel mode (but otherwise works in serial mode), please file an issue.
Some types of tests are not so well-suited to run in parallel. For example, extremely timing-sensitive tests, or tests which make I/O requests to a limited pool of resources (such as opening ports, or automating browser windows, hitting a test DB, or remote server, etc.).
Free-tier cloud CI services may not provide a suitable multi-core container or VM for their build agents. Regarding expected performance gains in CI: your mileage may vary. It may help to use a conditional in a .mocharc.js to check for process.env.CI, and adjust the job count as appropriate.
Each process launched by parallel mode is assigned a unique id, from 0 for the first process to be launched, to N-1 for the Nth process. This worker id may be accessed in tests via the environment variable MOCHA_WORKER_ID. It can be used for example to assign a different database, service port, etc for each test process.
In some cases, you may want a hook before (or after) every test in every file. These are called root hooks. Previous to v8.0.0, the way to accomplish this was to use --file combined with root hooks (see example above). This still works in v8.0.0, but not when running tests in parallel mode! For that reason, running root hooks using this method is strongly discouraged, and may be deprecated in the future.
Multiple root hook plugins can be registered by using --require multiple times. For example, to register the root hooks in hooks-a.js and hooks-b.js, use --require hooks-a.js --require hooks-b.js. These will be registered (and run) in order.
The require interface allows you to require the describe and friend words directly using require and call them whatever you want. This interface is also useful if you want to avoid global variables in your tests.
The Dot Matrix reporter is a series of characters which represent test cases. Failures highlight in red exclamation marks (!), pending tests with a blue comma (,), and slow tests as yellow. Good if you prefer minimal output.
The Markdown reporter generates a markdown TOC and body for your test suite. This is great if you want to use the tests as documentation within a Github wiki page, or a markdown file in the repository that Github can render. For example, here is the Connect test output.
A typical setup might look something like the following, where we call mocha.setup('bdd') to use the BDD interface before loading the test scripts, running them onload with mocha.run().
b37509886e