source: imaps-frontend/node_modules/uuid/dist/cjs-browser/test/stringify.test.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 1.2 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const assert = require("assert");
4const node_test_1 = require("node:test");
5const stringify_js_1 = require("../stringify.js");
6const BYTES = Uint8Array.of(0x0f, 0x5a, 0xbc, 0xd1, 0xc1, 0x94, 0x47, 0xf3, 0x90, 0x5b, 0x2d, 0xf7, 0x26, 0x3a, 0x08, 0x4b);
7(0, node_test_1.describe)('stringify', () => {
8 (0, node_test_1.default)('Stringify Array (unsafe)', () => {
9 assert.equal((0, stringify_js_1.unsafeStringify)(BYTES), '0f5abcd1-c194-47f3-905b-2df7263a084b');
10 });
11 (0, node_test_1.default)('Stringify w/ offset (unsafe)', () => {
12 const bytes = new Uint8Array(19).fill(0);
13 bytes.set(BYTES, 3);
14 assert.equal((0, stringify_js_1.unsafeStringify)(bytes, 3), '0f5abcd1-c194-47f3-905b-2df7263a084b');
15 });
16 (0, node_test_1.default)('Stringify Array (safe)', () => {
17 assert.equal((0, stringify_js_1.default)(BYTES), '0f5abcd1-c194-47f3-905b-2df7263a084b');
18 });
19 (0, node_test_1.default)('Throws on not enough values (safe)', () => {
20 const bytes = BYTES.slice(0, 15);
21 assert.throws(() => (0, stringify_js_1.default)(bytes));
22 });
23});
Note: See TracBrowser for help on using the repository browser.