Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2700159
test-helpers.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
test-helpers.js
View Options
/*
* This file is part of kazv.
* SPDX-FileCopyrightText: 2023 tusooa <tusooa@kazv.moe>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
class
FluentMock
{
constructor
()
{}
get
(
id
,
args
)
{
return
`
${
id
}
,
${
JSON
.
stringify
(
args
)
}
`
;
}
};
const
fluentMock
=
new
FluentMock
();
const
factory
=
{
room
(
props
)
{
return
Object
.
assign
({
name
:
'some name'
,
heroNames
:
[],
tagIds
:
[],
membership
:
1
,
// Join
timeline
:
0
,
},
props
);
},
};
const
deepEqual
=
(
a
,
b
)
=>
{
if
(
a
===
b
)
{
return
true
;
}
else
if
(
Array
.
isArray
(
a
)
&&
Array
.
isArray
(
b
))
{
if
(
a
.
length
!==
b
.
length
)
{
return
false
;
}
return
a
.
every
((
item
,
index
)
=>
deepEqual
(
item
,
b
[
index
]));
}
else
if
(
typeof
a
===
'object'
&&
typeof
b
===
'object'
&&
a
&&
b
)
{
const
ae
=
Object
.
entries
(
a
).
sort
(([
f
],
[
s
])
=>
f
>
s
?
1
:
f
<
s
?
-
1
:
0
);
const
be
=
Object
.
entries
(
b
).
sort
(([
f
],
[
s
])
=>
f
>
s
?
1
:
f
<
s
?
-
1
:
0
);
return
deepEqual
(
ae
,
be
);
}
else
{
return
false
;
}
};
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Fri, Jul 18, 12:27 PM (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
244792
Default Alt Text
test-helpers.js (1 KB)
Attached To
Mode
rK kazv
Attached
Detach File
Event Timeline
Log In to Comment