Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test("should call print with result", async () => {
const expected = migrateString(input);
expect(print).toHaveBeenCalledWith(expected);
});
});
test("should call print with result", async () => {
const expected = migrateString(
await readFile(join(fixturePath, "only-deployment.yaml"), "utf8")
);
expect(print).toHaveBeenCalledWith(expected);
});
});
test("should call print with result", async () => {
const contents = await Promise.all(
["only-deployment.yaml", "deployment-and-service.yaml"].map(file =>
readFile(join(fixturePath, file), "utf8")
)
);
const expected = migrateString("---\n" + contents.join("\n"));
expect(print).toHaveBeenCalledWith(expected);
});
});
test("should call print with result", async () => {
const files = await readDir(fixturePath);
const contents = await Promise.all(
files.map(file => readFile(join(fixturePath, file), "utf8"))
);
const expected = migrateString(contents.join("---\n"));
expect(print).toHaveBeenCalledWith(expected);
});
});
async handler(args) {
const file = concatFiles(await readFiles(args.cwd, toArray(args.filename)));
const content = migrateString(file);
await print(content);
}
};