2020-05-03 01:04:34 -07:00
|
|
|
import getValidPetPoses from "./getValidPetPoses";
|
|
|
|
|
|
|
|
describe("getValidPetPoses", () => {
|
|
|
|
it("gets them and writes them to a buffer", async () => {
|
|
|
|
const buffer = await getValidPetPoses();
|
2020-05-23 12:47:06 -07:00
|
|
|
expect(asBinaryString(buffer)).toMatchSnapshot();
|
2020-05-03 01:04:34 -07:00
|
|
|
});
|
|
|
|
});
|
2020-05-23 12:47:06 -07:00
|
|
|
|
|
|
|
function asBinaryString(buffer) {
|
|
|
|
let str = "";
|
|
|
|
for (let i = 0; i < buffer.length; i++) {
|
|
|
|
const byte = buffer.readUInt8(i);
|
|
|
|
str += byte.toString(2).padStart(8, "0") + "\n";
|
|
|
|
}
|
|
|
|
return str;
|
|
|
|
}
|