clean-code-metrics
Version:
metrics for clean code
30 lines (24 loc) • 1.06 kB
text/typescript
import list from "../../cli/list";
import chalk from "chalk";
const configPath = "src/TEST/test.config.json";
chalk.level = 0; // disable colors for compatibility e.g. pipeline
describe("test list", () => {
const info = jest.spyOn(console, "info").mockImplementation(undefined);
beforeEach(() => info.mockReset());
it("no filter, not verbose", async () => {
await list([], false, configPath); //TODO adapt when basebath can be set to actually not supply a filter
expect(info.mock.calls[0][0]).toMatchSnapshot();
});
it("no filter, verbose", async () => {
await list([], true, configPath); //TODO adapt when basebath can be set to actually not supply a filter
expect(info.mock.calls[0][0]).toMatchSnapshot();
});
it("filter, not verbose", async () => {
await list(["src/TEST/exampleDirTree/test.ts"], false, configPath);
expect(info.mock.calls[0][0]).toMatchSnapshot();
});
it("filter, verbose", async () => {
await list(["src/TEST/exampleDirTree/test.ts"], true, configPath);
expect(info.mock.calls[0][0]).toMatchSnapshot();
});
});