0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-02-24 22:05:56 -05:00
logto/packages/core/src/utils/domain.test.ts

12 lines
497 B
TypeScript

import { isSubdomainOf } from './domain.js';
describe('isSubdomainOf()', () => {
it('should return true if the given domain is a subdomain of a domain', () => {
expect(isSubdomainOf('subdomain.domain.com', 'domain.com')).toBe(true);
});
it('should return false if the given domain is not a subdomain of a domain', () => {
expect(isSubdomainOf('subdomain.domain.com', 'domain.org')).toBe(false);
expect(isSubdomainOf('subdomaindomain.com', 'domain.org')).toBe(false);
});
});