Files
browser-wakatime/tests/utils/getDomainFromUrl.spec.ts
Juan Sebastian velez Posada 35543489e5 Propmt when a api key can not be use + house keeping (#173)
* chore: remove old files

* chore: change JS tests to TS, delete dummy tests

* chore: bump manifests version
2023-02-22 08:11:16 -05:00

24 lines
741 B
TypeScript

import chai from 'chai';
import getDomainFromUrl from '../../src/utils/getDomainFromUrl';
const expect = chai.expect;
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');
});
});