ts-prime
Version:
A utility library for JavaScript and Typescript.
13 lines (12 loc) • 509 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var uuid_1 = require("./uuid");
var mockMath = Object.create(global.Math);
test('uuid mock test', function () {
mockMath.random = function () { return 0.5; };
global.Math = mockMath;
expect(uuid_1.uuidv4()).toEqual('88888888-8888-4888-8888-888888888888');
mockMath.random = function () { return 0.78798; };
global.Math = mockMath;
expect(uuid_1.uuidv4()).toEqual('cccccccc-cccc-4ccc-8ccc-cccccccccccc');
});