airbnb.io - mocha-wrap Fluent pluggable interface for easily wrapping `describe` and `it` blocks in Mocha tests39









Search Preview

Airbnb Engineering & Data Science

airbnb.io
Airbnb.io Open SourceEventsBlogGithubCareersAirbnb.io mocha-wrapFluent pluggable interface for easily wrapping `describe` and `it` blocks in Mocha tests39
.io > airbnb.io

SEO audit: Content analysis

Language Error! No language localisation is found.
Title Airbnb Engineering & Data Science
Text / HTML ratio 42 %
Frame Excellent! The website does not use iFrame solutions.
Flash Excellent! The website does not have any flash contents.
Keywords cloud function plugin mocha = var object functions => array tests mochawrap descriptor it'has CareersDesign string MochaWrapper test instance obj ran
Keywords consistency
Keyword Content Title Description Headings
function 28
plugin 7
mocha 7
= 6
var 5
object 5
Headings
H1 H2 H3 H4 H5 H6
1 5 0 0 0 0
Images We found 1 images on this web page.

SEO Keywords (Single)

Keyword Occurrence Density
function 28 1.40 %
plugin 7 0.35 %
mocha 7 0.35 %
= 6 0.30 %
var 5 0.25 %
object 5 0.25 %
functions 5 0.25 %
=> 5 0.25 %
array 5 0.25 %
tests 4 0.20 %
mochawrap 4 0.20 %
descriptor 4 0.20 %
it'has 3 0.15 %
CareersDesign 3 0.15 %
string 3 0.15 %
MochaWrapper 3 0.15 %
test 3 0.15 %
instance 3 0.15 %
obj 3 0.15 %
ran 3 0.15 %

SEO Keywords (Two Word)

Keyword Occurrence Density
in a 5 0.25 %
of functions 5 0.25 %
array of 5 0.25 %
function or 5 0.25 %
a function 5 0.25 %
use in 5 0.25 %
for use 5 0.25 %
plugin function 4 0.20 %
a mocha 4 0.20 %
or array 4 0.20 %
functions for 4 0.20 %
a MochaWrapper 3 0.15 %
a plugin 3 0.15 %
descriptor object 3 0.15 %
ran once 2 0.10 %
can be 2 0.10 %
a descriptor 2 0.10 %
all of 2 0.10 %
or all 2 0.10 %
any or 2 0.10 %

SEO Keywords (Three Word)

Keyword Occurrence Density Possible Spam
array of functions 5 0.25 % No
for use in 5 0.25 % No
a function or 5 0.25 % No
function or array 4 0.20 % No
use in a 4 0.20 % No
functions for use 4 0.20 % No
of functions for 4 0.20 % No
or array of 4 0.20 % No
in a mocha 4 0.20 % No
or all of 2 0.10 % No
wrap = require'mochawrap' 2 0.10 % No
var wrap = 2 0.10 % No
function setup ran 2 0.10 % No
a plugin function 2 0.10 % No
in Mocha tests 2 0.10 % No
blocks in Mocha 2 0.10 % No
any or all 2 0.10 % No
of a MochaWrapper 2 0.10 % No
a MochaWrapper instance 2 0.10 % No
for easily wrapping 2 0.10 % No

SEO Keywords (Four Word)

Keyword Occurrence Density Possible Spam
function or array of 4 0.20 % No
a function or array 4 0.20 % No
array of functions for 4 0.20 % No
of functions for use 4 0.20 % No
or array of functions 4 0.20 % No
use in a mocha 4 0.20 % No
functions for use in 4 0.20 % No
for use in a 4 0.20 % No
interface for easily wrapping 2 0.10 % No
Fluent pluggable interface for 2 0.10 % No
pluggable interface for easily 2 0.10 % No
any or all of 2 0.10 % No
var wrap = require'mochawrap' 2 0.10 % No
blocks in Mocha tests 2 0.10 % No
plugin function must have 1 0.05 % No
a name that starts 1 0.05 % No
have a name that 1 0.05 % No
must have a name 1 0.05 % No
function must have a 1 0.05 % No
Airbnbio Open Source Events 1 0.05 % No

Internal links in - airbnb.io

Open Source
Airbnb Engineering & Data Science
Events
Airbnb Engineering & Data Science
Airflow Use Apache Airflow (incubating) to author workflows as directed acyclic graphs (DAGs) of tasks8,613
Airbnb Engineering & Data Science
Aerosolve A machine learning package built for humans4,385
Airbnb Engineering & Data Science
BinaryAlert Serverless real-time and retroactive malware detection705
Airbnb Engineering & Data Science
AirMapView A view abstraction to provide a map user interface with various underlying map providers1,583
Airbnb Engineering & Data Science
Airpal Web UI for PrestoDB2,345
Airbnb Engineering & Data Science
DeepLinkDispatch Easy declaration and routing of your deep links2,990
Airbnb Engineering & Data Science
Enzyme JavaScript Testing utilities for React14,372
Airbnb Engineering & Data Science
Hammerspace Hash-like interface to persistent, concurrent, off-heap storage302
Airbnb Engineering & Data Science
Hypernova A service for server-side rendering your JavaScript views4,266
Airbnb Engineering & Data Science
Epoxy An Android library for building complex screens in a RecyclerView4,301
Airbnb Engineering & Data Science
Interferon Signaling you about infrastructure or application issues178
Airbnb Engineering & Data Science
JavaScript Style Guide A mostly reasonable approach to JavaScript73,101
Airbnb Engineering & Data Science
The Knowledge Repo A next-generation curated knowledge sharing platform for data scientists and other technical professions2,992
Airbnb Engineering & Data Science
Polyglot Give your JavaScript the ability to speak many languages2,734
Airbnb Engineering & Data Science
Nerve A service registration daemon that performs health checks; companion to airbnb/synapse837
Airbnb Engineering & Data Science
mocha-wrap Fluent pluggable interface for easily wrapping `describe` and `it` blocks in Mocha tests39
Airbnb Engineering & Data Science
Rheostat Rheostat is a www, mobile, and accessible slider component built with React1,248
Airbnb Engineering & Data Science
ReAir A collection of easy-to-use tools for replicating tables and partitions between Hive data warehouses206
Airbnb Engineering & Data Science
react-dates An accessible, easily internationalizable, mobile-friendly datepicker library for the web7,757
Airbnb Engineering & Data Science
Ruby Style Guide Airbnb's Ruby Style Guide2,366
Airbnb Engineering & Data Science
react-with-styles Use CSS-in-JavaScript with themes for React without being tightly coupled to one implementation1,242
Airbnb Engineering & Data Science
Superset Apache Superset (incubating) is a modern, enterprise-ready business intelligence web application19,842
Airbnb Engineering & Data Science
RxGroups Easily group RxJava Observables together and tie them to your Android Activity lifecycle668
Airbnb Engineering & Data Science
StreamAlert A serverless framework for real-time data analysis and alerting1,406
Airbnb Engineering & Data Science
Stemcell Airbnb's EC2 instance creation and bootstrapping tool157
Airbnb Engineering & Data Science
Synapse A transparent service discovery framework for connecting an SOA1,830
Airbnb Engineering & Data Science

Airbnb.io Spined HTML


Airbnb Engineering & Data Science Airbnb.io Open SourceEventsBlogGithubCareersAirbnb.io mocha-wrapFluent pluggable interface for hands wrapping `describe` and `it` blocks in Mocha tests39By Jordan HarbandFluent pluggable interface for hands wrapping describe, context, and it blocks in Mocha tests. Example var wrap = require('mocha-wrap'); var expect = require('chai').expect; var mockWindow = { location: { href: 'test/url' } }; wrap().withGlobal('window', () => mockWindow).describe('mocked window', function () { it('is mocked', function () { expect(window).to.equal(mockWindow); }); it('has the right URL', function () { expect(window.location.href).to.equal('test/url'); }); }); var obj = { a: 1 }; wrap().withOverrides(() => obj, () => ({ a: 2, b: 3 })).describe('overridden object keys', function () { it('has "b"', function () { expect(obj.b).to.equal(3); }); it('has overridden "a"', function () { expect(obj.a).to.equal(2); }); }); wrap().withOverride(() => obj, 'a', () => 4).skip().describe('this test is skipped', function () { it('also supports .only()!', function () { expect(true).to.equal(false); // skipped }); }); Plugins A mocha-wrap plugin is a named function that returns a MochaWrapper instance or a descriptor object. A plugin’s function name must uncork with the string “with”. Plugins can be globally registered, or .used ad-hoc. .use requires a plugin function as its first argument; remoter arguments are passed through to the plugin. .extend requires a non-empty unravelment string, and a descriptor object which may contain a value that is a function, or an variety of functions, whose keys correspond to any or all of the supported mocha methods. Globally registered plugins, .use calls, and .extend calls can be chained, stored, and reused - each link in the uniting creates a new instance of a MochaWrapper. A descriptor object may contain any or all of these 5 keys: a unravelment string, for use in “describe” and/or “it” (this is required when returning an object) beforeEach: a function, or variety of functions, for use in a mocha beforeEach function afterEach: a function, or variety of functions, for use in a mocha afterEach function before: a function, or variety of functions, for use in a mocha surpassing function after: a function, or variety of functions, for use in a mocha without function The most worldwide tideway will be for a plugin function to return this.extend(description, descriptor). A plugin function must have a name that starts with “with”, and will be invoked with a receiver (”this” value) of a MochaWrapper instance. To register a plugin, undeniability the register function on mocha-wrap with the plugin function. This should not be washed-up in a reusable module. module.exports = function withFoo(any, args, you, want) { return this.extend('with some foo stuff', { beforeEach: function () { // setup ran surpassing each test }, afterEach: [ function () { // teardown ran without each test }, function () { // increasingly teardown } ], before: function () { // setup ran once surpassing all tests }, after: function () { // teardown ran once without all tests } }); }; Usage var wrap = require('mocha-wrap'); wrap.register(require('mocha-wrap-with-foo')); wrap().withFoo().describe… skip/only Although mocha has describe.skip, describe.only, context.skip, context.only, it.skip, and it.only, it is not possible to implement these in mocha-wrap without using ES5 property accessors. Since this project supports ES3, we decided to use .skip().describe etc rather than forfeit the worthiness to have skip/only. Tests Simply clone the repo, npm install, and run npm testLinksGithubmocha© Airbnb, Inc.© Airbnb, Inc.CareersDesignCareersDesignCareersDesign