mirror of
https://github.com/vale981/tridactyl
synced 2025-03-08 19:01:40 -05:00
25 lines
460 B
TypeScript
25 lines
460 B
TypeScript
import * as msgsafe from "./msgsafe"
|
|
|
|
const allsafe = {
|
|
a: 1,
|
|
b: true,
|
|
c: "three",
|
|
// d: null,
|
|
e: undefined,
|
|
}
|
|
|
|
function helper(testname, obj, safeobj) {
|
|
test(testname, () => expect(msgsafe.generic(obj)).toMatchObject(safeobj))
|
|
}
|
|
|
|
helper("allsafe", allsafe, allsafe)
|
|
helper("remove function", { f: () => {}, b: 1 }, { b: 1 })
|
|
helper(
|
|
"remove all bad",
|
|
{
|
|
a: Symbol(),
|
|
b: () => {},
|
|
c: {},
|
|
},
|
|
{},
|
|
)
|