Skip to content

Commit

Permalink
refactor(betterer 🔧): add .js extensions to imports
Browse files Browse the repository at this point in the history
  • Loading branch information
phenomnomnominal committed Jul 17, 2023
1 parent 0833c8d commit 67fc88d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 1 addition & 4 deletions packages/cli/src/precommit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,10 @@ export function precommit(cwd: string): Command {
// And then cast to BettererOptionsStart. This is possibly invalid,
// but it's nicer to do the options validation in @betterer/betterer
const suiteSummary = await betterer(options as BettererOptionsStart);
process.stderr.write(JSON.stringify(suiteSummary.worse));
process.stderr.write(JSON.stringify(suiteSummary.failed));
if (suiteSummary.worse.length > 0 || suiteSummary.failed.length > 0) {
process.exitCode = 1;
}
} catch (e) {
process.stderr.write(JSON.stringify(e));
} catch {
process.exitCode = 1;
}
});
Expand Down
6 changes: 4 additions & 2 deletions test/cli/precommit-add.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,16 @@ export default {

await cli__(fixturePath, [...ARGV, 'start'], false);

expect(process.exitCode).toBeUndefined();

await writeFile(indexPath, `const a = 'a';\nconst one = 1;\nconsole.log(one + one);`);

await cli__(fixturePath, [...ARGV, 'precommit']);

expect(logs).toMatchSnapshot();

expect(process.exitCode).toBeUndefined();

expect(logs).toMatchSnapshot();

const git = simpleGit();
await git.init();
const status = await git.status([paths.results]);
Expand Down

0 comments on commit 67fc88d

Please sign in to comment.