File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import { IssueCategory } from '@/schemas';
2525// Unit tests can be run from the /ui folder with:
2626// pnpm test
2727const issueCategoryMap : Record < IssueCategory , RegExp [ ] > = {
28+ Deprecation : [ / ^ d e p r e c a t e d .* / ] ,
2829 Infrastructure : [
2930 / T h e .* w o r k e r f a i l e d d u e t o a n u n e x p e c t e d e r r o r .* / ,
3031 / E R R O R : T i m e o u t a f t e r .* s e c o n d s w h i l e s c a n n i n g f i l e ' .* ' \. / ,
@@ -66,6 +67,18 @@ export const getIssueCategory = (message: string): IssueCategory => {
6667if ( import . meta. vitest ) {
6768 const { it, expect } = import . meta. vitest ;
6869
70+ it ( 'correctly categorizes deprecation issues' , ( ) => {
71+ const messages = [
72+ 'deprecated @npmcli/[email protected] : This functionality has been moved to @npmcli/fs' , 73+ 'deprecated [email protected] : Glob versions prior to v9 are no longer supported' , 74+ 'deprecated [email protected] : Please upgrade to version 7 or higher.' , 75+ ] ;
76+
77+ messages . forEach ( ( message ) => {
78+ expect ( getIssueCategory ( message ) ) . toBe ( 'Deprecation' ) ;
79+ } ) ;
80+ } ) ;
81+
6982 it ( 'correctly categorizes infrastructure issues' , ( ) => {
7083 const messages = [
7184 'The analyzer worker failed due to an unexpected error.' ,
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ export type ItemResolved = z.infer<typeof itemResolvedSchema>;
3131// Enum schema and type for the possible values of the issue categories.
3232export const issueCategorySchema = z . enum ( [
3333 'Build System' ,
34+ 'Deprecation' ,
3435 'Missing Data' ,
3536 'Infrastructure' ,
3637 'Other' ,
You can’t perform that action at this time.
0 commit comments