feat(email): define array of popular email domains (#18) r=@vladikoff

This commit is contained in:
Phil Booth 2018-04-03 14:49:35 +01:00 коммит произвёл Vlad Filippov
Родитель 208804ad6c
Коммит bb65ca64cf
5 изменённых файлов: 36 добавлений и 2 удалений

Просмотреть файл

@ -0,0 +1,5 @@
[
"gmail.com", "hotmail.com", "yahoo.com", "mail.ru", "outlook.com", "aol.com", "qq.com",
"web.de", "yandex.ru", "gmx.de", "live.com", "comcast.net", "t-online.de", "hotmail.fr",
"msn.com", "yahoo.fr", "orange.fr", "163.com", "icloud.com", "hotmail.co.uk"
]

Просмотреть файл

@ -1,5 +1,8 @@
module.exports = {
email: {
popularDomains: require('./email/popularDomains')
},
l10n: {
localizeTimestamp: require('./l10n/localizeTimestamp'),
supportedLanguages: require('./l10n/supportedLanguages')

Просмотреть файл

@ -0,0 +1,26 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
'use strict';
const { assert } = require('chai');
describe('email/popularDomains:', () => {
let popularDomains;
before(() => {
popularDomains = require('../../email/popularDomains');
});
it('returns an array of 20 domains', () => {
assert.isArray(popularDomains);
assert.lengthOf(popularDomains, 20);
});
it('includes some well-known domains', () => {
assert.isAtLeast(popularDomains.indexOf('gmail.com'), 0);
assert.isAtLeast(popularDomains.indexOf('hotmail.com'), 0);
assert.isAtLeast(popularDomains.indexOf('yahoo.com'), 0);
});
});

Просмотреть файл

@ -6,7 +6,7 @@
const { assert } = require('chai');
describe('localizeTimestamp:', () => {
describe('l10n/localizeTimestamp:', () => {
let localizeTimestamp;
before(() => {

Просмотреть файл

@ -6,7 +6,7 @@
const { assert } = require('chai');
describe('supportedLanguages:', () => {
describe('l10n/supportedLanguages:', () => {
let supportedLanguages;
before(() => {