2020-02-23 19:42:36 +00:00
|
|
|
import 'mocha';
|
|
|
|
import { expect } from 'chai';
|
|
|
|
import { IMAPAuth } from '../../src/auth/IMAPAuth';
|
|
|
|
|
|
|
|
describe('test imap auth', () => {
|
|
|
|
it('authenticate against imap server', async () => {
|
|
|
|
const auth = new IMAPAuth({
|
|
|
|
host: 'imap.gmail.com',
|
|
|
|
port: 993,
|
|
|
|
useSecureTransport: true,
|
2020-05-14 13:02:15 +00:00
|
|
|
validHosts: ['gmail.com'],
|
2020-02-23 19:42:36 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
const result = await auth.authenticate('username', 'password');
|
|
|
|
|
|
|
|
expect(result).to.equal(true);
|
|
|
|
});
|
|
|
|
});
|