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
7b5d449e
Commit
7b5d449e
authored
Oct 08, 2014
by
Ben Drucker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Basic API client
parent
391bd402
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
client.js
src/client.js
+13
-0
client.js
test/client.js
+24
-0
No files found.
src/client.js
0 → 100644
View file @
7b5d449e
'use strict'
;
var
assert
=
require
(
'assert'
);
function
ClearbitClient
(
config
)
{
config
=
config
||
{};
assert
(
this
instanceof
ClearbitClient
,
'Client must be called with new'
);
assert
(
!!
config
.
key
,
'An API key must be provided'
);
this
.
key
=
config
.
key
;
};
module
.
exports
=
ClearbitClient
;
\ No newline at end of file
test/client.js
0 → 100644
View file @
7b5d449e
'use strict'
;
var
expect
=
require
(
'chai'
).
expect
;
var
ClearbitClient
=
require
(
'../src/client'
);
describe
(
'ClearbitClient'
,
function
()
{
it
(
'must be called with new'
,
function
()
{
expect
(
ClearbitClient
).
to
.
throw
(
/called with new/
);
});
it
(
'must provide an API key'
,
function
()
{
expect
(
function
()
{
return
new
ClearbitClient
();
})
.
to
.
throw
(
/API key/
);
});
it
(
'configures the API key'
,
function
()
{
expect
(
new
ClearbitClient
({
key
:
'k'
})).
to
.
have
.
property
(
'key'
,
'k'
);
});
});
\ No newline at end of file
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