Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fullcontact
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
fullcontact
Commits
ce272d51
Commit
ce272d51
authored
May 15, 2013
by
3rd-Eden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[test] Adding more tests for the endpoints
parent
8b0f878a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
154 additions
and
0 deletions
+154
-0
email.test.js
test/email.test.js
+32
-0
location.test.js
test/location.test.js
+42
-0
name.test.js
test/name.test.js
+80
-0
No files found.
test/email.test.js
0 → 100644
View file @
ce272d51
describe
(
'FullContact.Email'
,
function
()
{
'use strict'
;
var
FullContact
=
require
(
'../'
)
,
chai
=
require
(
'chai'
)
,
expect
=
chai
.
expect
;
chai
.
Assertion
.
includeStack
=
true
;
//
// The API key we use for testing.
//
var
key
=
process
.
env
.
API_KEY
;
//
// Some of the requests take a really long time, so set a really long timeout
//
this
.
timeout
(
20000
);
//
// Pre-create an API instance
//
var
api
=
new
FullContact
(
key
);
describe
(
'#disposable'
,
function
()
{
it
(
'is it an disposable e-mail address'
,
function
(
done
)
{
api
.
email
.
disposable
(
'arnout@observe.it'
,
done
);
});
it
(
'provides the proper casing'
);
});
});
test/location.test.js
0 → 100644
View file @
ce272d51
describe
(
'FullContact.Location'
,
function
()
{
'use strict'
;
var
FullContact
=
require
(
'../'
)
,
chai
=
require
(
'chai'
)
,
expect
=
chai
.
expect
;
chai
.
Assertion
.
includeStack
=
true
;
//
// The API key we use for testing.
//
var
key
=
process
.
env
.
API_KEY
;
//
// Some of the requests take a really long time, so set a really long timeout
//
this
.
timeout
(
20000
);
//
// Pre-create an API instance
//
var
api
=
new
FullContact
(
key
);
describe
(
'#normalize'
,
function
()
{
it
(
'it normalizes the given name'
,
function
(
done
)
{
api
.
location
.
normalize
(
'denver'
,
done
);
});
it
(
'provides the proper casing'
);
it
(
'includes zero population'
);
});
describe
(
'#enrich'
,
function
()
{
it
(
'provides location enrichment'
,
function
(
done
)
{
api
.
location
.
enrich
(
'denver'
,
done
);
});
it
(
'provides the proper casing'
);
it
(
'includes zero population'
);
});
});
test/name.test.js
0 → 100644
View file @
ce272d51
describe
(
'FullContact.Name'
,
function
()
{
'use strict'
;
var
FullContact
=
require
(
'../'
)
,
chai
=
require
(
'chai'
)
,
expect
=
chai
.
expect
;
chai
.
Assertion
.
includeStack
=
true
;
//
// The API key we use for testing.
//
var
key
=
process
.
env
.
API_KEY
;
//
// Some of the requests take a really long time, so set a really long timeout
//
this
.
timeout
(
20000
);
//
// Pre-create an API instance
//
var
api
=
new
FullContact
(
key
);
describe
(
'#normalize'
,
function
()
{
it
(
'normalizes the name'
,
function
(
done
)
{
api
.
name
.
normalize
(
'john Smith'
,
done
);
});
it
(
'provides the proper casing'
);
});
describe
(
'#deducer'
,
function
()
{
it
(
'deduces email addresses'
,
function
(
done
)
{
api
.
name
.
deducer
({
email
:
'johndsmith870@corp.com'
},
done
);
});
it
(
'deduces usernames'
,
function
(
done
)
{
api
.
name
.
deducer
({
username
:
'johndsmith870'
},
done
);
});
it
(
'provides the proper casing'
);
});
describe
(
'#similarity'
,
function
()
{
it
(
'checks the similarity of 2 given names'
,
function
(
done
)
{
api
.
name
.
similarity
(
'john'
,
'johns'
,
done
);
});
it
(
'provides the proper casing'
);
});
describe
(
'#stats'
,
function
()
{
it
(
'provides stats for a name'
,
function
(
done
)
{
api
.
name
.
stats
({
name
:
'john'
},
done
);
});
it
(
'provides stats for a given name'
,
function
(
done
)
{
api
.
name
.
stats
({
givenName
:
'john'
},
done
);
});
it
(
'provides stats for a family name'
,
function
(
done
)
{
api
.
name
.
stats
({
familyName
:
'smith'
},
done
);
});
it
(
'provides stats for a given and family name'
,
function
(
done
)
{
api
.
name
.
stats
({
familyName
:
'smith'
,
givenName
:
'john'
},
done
);
});
it
(
'provides the proper casing'
);
});
describe
(
'#parser'
,
function
()
{
it
(
'parses the name'
,
function
(
done
)
{
api
.
name
.
parser
(
'john smith'
,
done
);
});
it
(
'provides the proper casing'
);
});
});
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