File tree 4 files changed +62
-1
lines changed
4 files changed +62
-1
lines changed Original file line number Diff line number Diff line change 74
74
"dependencies" : {
75
75
"@commitlint/config-conventional" : " 17.4.4" ,
76
76
"@commitlint/types" : " 17.4.4" ,
77
+ "@flex-development/tutils" : " 6.0.0-alpha.10" ,
77
78
"conventional-changelog-conventionalcommits" : " 5.0.0"
78
79
},
79
80
"devDependencies" : {
82
83
"@flex-development/mkbuild" : " 1.0.0-alpha.14" ,
83
84
"@flex-development/mlly" : " 1.0.0-alpha.13" ,
84
85
"@flex-development/pathe" : " 1.0.3" ,
85
- "@flex-development/tutils" : " 6.0.0-alpha.10" ,
86
86
"@graphql-eslint/eslint-plugin" : " 3.16.0" ,
87
87
"@types/chai" : " 4.3.4" ,
88
88
"@types/conventional-changelog" : " 3.1.1" ,
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @file Type Tests - Questions
3
+ * @module commitlint-config/types/tests/unit-d/Questions
4
+ */
5
+
6
+ import { PromptKind , Scope , Type } from '#src/enums'
7
+ import type Question from '../question'
8
+ import type QuestionEnum from '../question-enum'
9
+ import type TestSubject from '../questions'
10
+
11
+ describe ( 'unit-d:types/Questions' , ( ) => {
12
+ it ( 'should extend Record<PromptKind, Question>' , ( ) => {
13
+ expectTypeOf < TestSubject > ( ) . toMatchTypeOf < Record < PromptKind , Question > > ( )
14
+ } )
15
+
16
+ it ( 'should match [PromptKind.SCOPE: Question<Scope>]' , ( ) => {
17
+ expectTypeOf < TestSubject > ( )
18
+ . toHaveProperty ( PromptKind . SCOPE )
19
+ . toEqualTypeOf < Question < Scope > > ( )
20
+ } )
21
+
22
+ it ( 'should match [PromptKind.TYPE: Question<Type, Required<QuestionEnum>>]' , ( ) => {
23
+ expectTypeOf < TestSubject > ( )
24
+ . toHaveProperty ( PromptKind . TYPE )
25
+ . toEqualTypeOf < Question < Type , Required < QuestionEnum > > > ( )
26
+ } )
27
+ } )
Original file line number Diff line number Diff line change 6
6
export type { default as NoteKeyword } from './note-keyword'
7
7
export type { default as Question } from './question'
8
8
export type { default as QuestionEnum } from './question-enum'
9
+ export type { default as Questions } from './questions'
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @file Type Definitions - Questions
3
+ * @module commitlint-config/types/Questions
4
+ */
5
+
6
+ import type { PromptKind , Scope , Type } from '#src/enums'
7
+ import type { Overwrite } from '@flex-development/tutils'
8
+ import type Question from './question'
9
+ import type QuestionEnum from './question-enum'
10
+
11
+ /**
12
+ * Prompt questions.
13
+ *
14
+ * @see https://commitlint.js.org/#/reference-prompt?id=questions
15
+ *
16
+ * @extends {Record<PromptKind,Question> }
17
+ */
18
+ type Questions = Overwrite <
19
+ Record < PromptKind , Question > ,
20
+ {
21
+ /**
22
+ * Commit scope questions configuration.
23
+ */
24
+ [ PromptKind . SCOPE ] : Question < Scope >
25
+
26
+ /**
27
+ * Commit type questions configuration.
28
+ */
29
+ [ PromptKind . TYPE ] : Question < Type , Required < QuestionEnum > >
30
+ }
31
+ >
32
+
33
+ export type { Questions as default }
You can’t perform that action at this time.
0 commit comments