Skip to content

Every analytics tool wants a subscription. And your data. I built Twiligent instead. YouTube stats. Instagram stats. One dashboard. Runs locally on your machine.

585 B
Raw Blame
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { looksLikeEmail } from '../../src/lib/emailAddress.ts';

test('an address with a name, an @ and a domain with a dot is ready to continue', () => {
  assert.equal(looksLikeEmail('[email protected]'), true);
  assert.equal(looksLikeEmail('  [email protected] '), true);
});

test('a half-typed address is not', () => {
  for (const value of ['', 'asha', 'asha@', 'asha@northwind', '[email protected]', 'a [email protected]']) {
    assert.equal(looksLikeEmail(value), false, value);
  }
});