Skip to content

Commit

Permalink
feat(cli): log stack when an error occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
gregberge committed Nov 23, 2022
1 parent 13606de commit 0c47590
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ program
spinner.succeed(`Build created: ${result.build.url}`);
} catch (error: any) {
spinner.fail(`Build failed: ${error.message}`);
console.error(error.stack);
process.exit(1);
}
});
Expand Down
6 changes: 6 additions & 0 deletions packages/core/src/discovery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import { discoverScreenshots } from "./discovery";
// const __dirname = fileURLToPath(new URL(".", import.meta.url));

describe("#discoverScreenshots", () => {
it("returns empty array if no screenshots are found", async () => {
const screenshots = await discoverScreenshots(["**/*.{png,jpg,jpeg}"], {
root: join(__dirname, "../../../__fixtures__/not-found"),
});
expect(screenshots).toEqual([]);
});
it("finds all images", async () => {
const screenshots = await discoverScreenshots(["**/*.{png,jpg,jpeg}"], {
root: join(__dirname, "../../../__fixtures__/screenshots"),
Expand Down

0 comments on commit 0c47590

Please sign in to comment.