Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronMoat committed Jan 7, 2024
1 parent 305b8b6 commit 6ca5431
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions src/cli/lint/annotate/github/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ const prettierOutput: PrettierOutput = {
const internalOutput: InternalLintResult = {
ok: false,
fixable: false,
annotations: [
{
path: 'src/index.ts',
message: 'something is wrong about this',
},
],
};

const tscOk = false;
Expand All @@ -65,6 +71,17 @@ const tscOutputStream = {
output: mockOutput,
} as unknown as StreamInterceptor;

const mockInternalAnnotations: GitHub.Annotation[] = [
{
annotation_level: 'failure',
end_line: 1,
message: 'something is wrong about this',
path: 'src/index.ts',
start_line: 1,
title: 'skuba lint',
},
];

const mockEslintAnnotations: GitHub.Annotation[] = [
{
annotation_level: 'failure',
Expand Down Expand Up @@ -178,6 +195,7 @@ it('should call createTscAnnotations with tscOk and tscOutputStream', async () =

it('should combine all the annotations into an array for the check run', async () => {
const expectedAnnotations: GitHub.Annotation[] = [
...mockInternalAnnotations,
...mockEslintAnnotations,
...mockPrettierAnnotations,
...mockTscAnnotations,
Expand Down
2 changes: 1 addition & 1 deletion src/cli/lint/internalLints/noSkubaTemplateJs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('noSkubaTemplateJs', () => {
annotations: [
{
message: 'Template is incomplete; run pnpm exec skuba configure.',
path: '/Users/amoat/Programming/seek-oss/skuba/skuba.template.js',
path: 'skuba.template.js',
},
],
});
Expand Down
2 changes: 1 addition & 1 deletion src/cli/lint/internalLints/noSkubaTemplateJs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const noSkubaTemplateJs = async (
fixable: false,
annotations: [
{
path: templateConfigPath,
path: 'skuba.template.js',
message: `Template is incomplete; run ${packageManager.exec} skuba configure.`,
},
],
Expand Down

0 comments on commit 6ca5431

Please sign in to comment.