UNPKG

node-elizabeth

Version:
62 lines (45 loc) 1.82 kB
'use strict'; var _providers = require('../providers.js'); var _hardware = require('../locales/int/hardware.js'); var _util = require('./../util'); var hardware = new _providers.Hardware(); describe('Test hardware provider', function () { it('should be in array', function () { expect(_hardware.RESOLUTIONS).toContain(hardware.resolution()); }); it('should be in array', function () { expect(_hardware.SCREEN_SIZES).toContain(hardware.screenSize()); }); it('should be in array', function () { expect(_hardware.CPU).toContain(hardware.cpu()); }); it('should be formated string', function () { expect(hardware.cpuFrequency()).toMatch(/^[0-9]{1}.[0-9]{1}(GHz)|[0-9]{1}(GHz)$/); }); it('should be in array', function () { expect(_hardware.GENERATION).toContain(hardware.generation()); expect(_hardware.GENERATION_ABBR).toContain(hardware.generation({ abbr: true })); }); it('should be in array', function () { expect(_hardware.CPU_CODENAMES).toContain(hardware.cpuCodename()); }); it('should be in array', function () { expect(['DDR2', 'DDR3', 'DDR4']).toContain(hardware.ramType()); }); it('should be in array', function () { expect(['4', '6', '8', '16', '32', '64']).toContain(hardware.ramSize().replace('GB', '')); expect(hardware.ramSize()).toMatch(/^[0-9]{1,2}(GB)$/); }); it('should be in array', function () { expect(_hardware.HDD_SSD).toContain(hardware.ssdOrHdd()); }); it('should be in array', function () { expect(_hardware.GRAPHICS).toContain(hardware.graphics()); }); it('should be in array', function () { expect(_hardware.MANUFACTURERS).toContain(hardware.manufacturer()); }); it('should be in array', function () { expect(_hardware.PHONE_MODELS).toContain(hardware.phoneModel()); }); });