Added StringHelpers, UniqIdGenerators and UrlParser test

UniqIdGenerators skips window.crypt test

URL tests need to be more in detail
This commit is contained in:
2025-03-07 19:01:58 +09:00
parent ea9882256e
commit 233fb6a235
8 changed files with 118 additions and 32 deletions

22
tests/UrlParser.test.js Normal file
View File

@@ -0,0 +1,22 @@
import { describe, it, expect } from "vitest";
import {
parseQueryString,
getQueryStringParam,
} from '../src/utils/UrlParser.mjs';
describe("parseQueryString", () => {
it('Should parse query string for key', () => {
let kv = parseQueryString("http://foor.org?key=value");
expect(kv).toEqual({"http://foor.org?key": "value"});
});
});
describe("getQueryStringParam", () => {
it('Should parse query string for key', () => {
let kv = getQueryStringParam("key", "http://foor.org?key=value");
expect(kv).toEqual("value");
});
});
// __END__