Test fixes for UrlParser, HtmlElementCreator
All checks were successful
CI / ci-tests (push) Successful in 15s
All checks were successful
CI / ci-tests (push) Successful in 15s
Also fix old parseQueryString and alias it to getQueryStringParam
This commit is contained in:
@@ -7,6 +7,11 @@ import {
|
||||
} from '../src/utils/FormatBytes.mjs';
|
||||
|
||||
let bytes_map = [
|
||||
{
|
||||
"in": "120MB",
|
||||
"out": "120MB",
|
||||
"out_l": "120MB",
|
||||
},
|
||||
{
|
||||
"in": -123123123,
|
||||
"out": "-120237.42kB",
|
||||
@@ -57,6 +62,7 @@ describe("formatBytes", () => {
|
||||
it('convert bytes to human readable, round up to next set', () => {
|
||||
// expect(formatBytes(1021152)).toBe('0.97MB');
|
||||
for (const bytes of bytes_map) {
|
||||
// @ts-ignore
|
||||
expect(formatBytes(bytes.in)).toBe(bytes.out);
|
||||
}
|
||||
});
|
||||
@@ -66,6 +72,7 @@ describe("formatBytesLong", () => {
|
||||
it('convert bytes to human readable, keep on current set', () => {
|
||||
expect(formatBytesLong(1021152)).toBe('997.22 KB');
|
||||
for (const bytes of bytes_map) {
|
||||
// @ts-ignore
|
||||
expect(formatBytesLong(bytes.in)).toBe(bytes.out_l);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user