Written tests for contains, in_array and getDomainFromUrl.
This commit is contained in:
@@ -7,4 +7,13 @@ describe('getDomainFromUrl', function() {
|
||||
it('should be a function', function() {
|
||||
expect(getDomainFromUrl).to.be.a('function');
|
||||
});
|
||||
|
||||
it('should return the domain', function() {
|
||||
expect(getDomainFromUrl('http://google.com/something/very/secret')).to.equal('http://google.com');
|
||||
|
||||
expect(getDomainFromUrl('http://www.google.com/something/very/secret')).to.equal('http://www.google.com');
|
||||
|
||||
// This is not how it was imaged to work, but let's leave it here as a warning.
|
||||
expect(getDomainFromUrl('google.com/something/very/secret')).to.equal('google.com//very');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user