mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-25 02:57:30 +00:00
Confirm that getFormattedId is reversable
This commit is contained in:
parent
4e52a67d39
commit
6eebad5e9c
1 changed files with 16 additions and 1 deletions
|
|
@ -1,6 +1,21 @@
|
|||
import { getClass } from "./objects";
|
||||
import { getClass, getFormattedId, objects } from "./objects";
|
||||
import runtime from "../runtime";
|
||||
|
||||
test("getFormattedId() is reversable", () => {
|
||||
Object.keys(runtime).forEach(id => {
|
||||
const formattedId = getFormattedId(id);
|
||||
const inverse = getFormattedId(formattedId);
|
||||
expect(inverse).toBe(id);
|
||||
});
|
||||
Object.keys(objects)
|
||||
.map(id => id.toLowerCase())
|
||||
.forEach(id => {
|
||||
const formattedId = getFormattedId(id);
|
||||
const inverse = getFormattedId(formattedId);
|
||||
expect(inverse).toBe(id);
|
||||
});
|
||||
});
|
||||
|
||||
const getMakiMethods = obj =>
|
||||
Object.getOwnPropertyNames(obj).filter(name => {
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue