Search Preview
Airbnb Engineering & Data Science
airbnb.ioAirbnb.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 |
|
||||||||||||||||||||||||||||||||||||
Headings |
|
||||||||||||||||||||||||||||||||||||
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
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
Airbnb Engineering & Data Science
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