Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
clearbit
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
prospector
clearbit
Commits
152d92ea
Commit
152d92ea
authored
Oct 10, 2014
by
Ben Drucker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provide a client constructor as the base export
parent
40d8e567
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
17 deletions
+24
-17
index.js
src/index.js
+11
-0
client.js
test/client.js
+11
-13
company.js
test/company.js
+1
-2
person.js
test/person.js
+1
-2
No files found.
src/index.js
0 → 100644
View file @
152d92ea
'use strict'
;
var
Client
=
require
(
'./client'
);
module
.
exports
=
function
(
key
)
{
return
new
Client
({
key
:
key
});
};
module
.
exports
.
Client
=
Client
;
test/client.js
View file @
152d92ea
'use strict'
;
'use strict'
;
var
expect
=
require
(
'chai'
).
expect
;
var
expect
=
require
(
'chai'
).
expect
;
var
nock
=
require
(
'nock'
);
var
nock
=
require
(
'nock'
);
var
ClearbitClient
=
require
(
'../src/client'
);
var
clearbit
=
require
(
'../'
);
var
pkg
=
require
(
'../package.json'
);
var
Client
=
clearbit
.
Client
;
var
pkg
=
require
(
'../package.json'
);
describe
(
'Cl
earbitCl
ient'
,
function
()
{
describe
(
'Client'
,
function
()
{
var
client
;
var
client
;
beforeEach
(
function
()
{
beforeEach
(
function
()
{
client
=
new
ClearbitClient
({
client
=
clearbit
(
'k'
);
key
:
'k'
});
});
});
describe
(
'Constructor'
,
function
()
{
describe
(
'Constructor'
,
function
()
{
it
(
'must be called with new'
,
function
()
{
it
(
'must be called with new'
,
function
()
{
expect
(
Cl
earbitCl
ient
).
to
.
throw
(
/called with new/
);
expect
(
Client
).
to
.
throw
(
/called with new/
);
});
});
it
(
'must provide an API key'
,
function
()
{
it
(
'must provide an API key'
,
function
()
{
expect
(
function
()
{
expect
(
function
()
{
return
new
Cl
earbitCl
ient
();
return
new
Client
();
})
})
.
to
.
throw
(
/API key/
);
.
to
.
throw
(
/API key/
);
});
});
it
(
'configures the API key'
,
function
()
{
it
(
'configures the API key'
,
function
()
{
expect
(
new
Cl
earbitCl
ient
({
key
:
'k'
})).
to
.
have
.
property
(
'key'
,
'k'
);
expect
(
new
Client
({
key
:
'k'
})).
to
.
have
.
property
(
'key'
,
'k'
);
});
});
});
});
...
@@ -123,4 +122,4 @@ describe('ClearbitClient', function () {
...
@@ -123,4 +122,4 @@ describe('ClearbitClient', function () {
});
});
});
});
\ No newline at end of file
test/company.js
View file @
152d92ea
...
@@ -2,8 +2,7 @@
...
@@ -2,8 +2,7 @@
var
expect
=
require
(
'chai'
).
expect
;
var
expect
=
require
(
'chai'
).
expect
;
var
nock
=
require
(
'nock'
);
var
nock
=
require
(
'nock'
);
var
Client
=
require
(
'../src/client'
);
var
Company
=
require
(
'../'
)(
'k'
).
Company
;
var
Company
=
new
Client
({
key
:
'k'
}).
Company
;
describe
(
'Company'
,
function
()
{
describe
(
'Company'
,
function
()
{
...
...
test/person.js
View file @
152d92ea
...
@@ -2,8 +2,7 @@
...
@@ -2,8 +2,7 @@
var
expect
=
require
(
'chai'
).
expect
;
var
expect
=
require
(
'chai'
).
expect
;
var
nock
=
require
(
'nock'
);
var
nock
=
require
(
'nock'
);
var
Client
=
require
(
'../src/client'
);
var
Person
=
require
(
'../'
)(
'k'
).
Person
;
var
Person
=
new
Client
({
key
:
'k'
}).
Person
;
describe
(
'Person'
,
function
()
{
describe
(
'Person'
,
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment