fix(core): update
This commit is contained in:
20
test/test.ts
20
test/test.ts
@ -1,31 +1,31 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import * as smartmail from '../ts/index';
|
||||
import * as smartmail from '../ts/index.js';
|
||||
|
||||
let emailAddressValidatorInstance: smartmail.EmailAddressValidator;
|
||||
|
||||
tap.test('should create an instance of EmailAddressValidator', async () => {
|
||||
emailAddressValidatorInstance = new smartmail.EmailAddressValidator();
|
||||
expect(emailAddressValidatorInstance).to.be.instanceOf(smartmail.EmailAddressValidator);
|
||||
expect(emailAddressValidatorInstance).toBeInstanceOf(smartmail.EmailAddressValidator);
|
||||
});
|
||||
|
||||
tap.test('should validate an email', async () => {
|
||||
const result = await emailAddressValidatorInstance.validate('sandbox@bleu.de');
|
||||
expect(result.freemail).to.be.false;
|
||||
expect(result.disposable).to.be.false;
|
||||
expect(result.freemail).toBeFalse();
|
||||
expect(result.disposable).toBeFalse();
|
||||
console.log(result);
|
||||
});
|
||||
|
||||
tap.test('should recognize an email as freemail', async () => {
|
||||
const result = await emailAddressValidatorInstance.validate('sandbox@gmail.com');
|
||||
expect(result.freemail).to.be.true;
|
||||
expect(result.disposable).to.be.false;
|
||||
expect(result.freemail).toBeTrue();
|
||||
expect(result.disposable).toBeFalse();
|
||||
console.log(result);
|
||||
});
|
||||
|
||||
tap.test('should recognize an email as disposable', async () => {
|
||||
const result = await emailAddressValidatorInstance.validate('sandbox@gmx.de');
|
||||
expect(result.freemail).to.be.false;
|
||||
expect(result.disposable).to.be.true;
|
||||
expect(result.freemail).toBeFalse();
|
||||
expect(result.disposable).toBeTrue();
|
||||
console.log(result);
|
||||
});
|
||||
|
||||
@ -33,9 +33,9 @@ tap.test('should create a SmartMail', async () => {
|
||||
const testSmartmail = new smartmail.Smartmail({
|
||||
body: 'hi there',
|
||||
from: 'noreply@mail.lossless.com',
|
||||
subject: 'hi from here'
|
||||
subject: 'hi from here',
|
||||
});
|
||||
expect(testSmartmail).to.be.instanceof(smartmail.Smartmail);
|
||||
expect(testSmartmail).toBeInstanceOf(smartmail.Smartmail);
|
||||
});
|
||||
|
||||
tap.start();
|
||||
|
Reference in New Issue
Block a user