Skip to content

Commit 84121ee

Browse files
authored
fix: make rule message punctuation consistent (#1444)
1 parent 90488de commit 84121ee

13 files changed

+21
-21
lines changed

src/rules/max-expects.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default createRule({
1616
},
1717
messages: {
1818
exceededMaxAssertion:
19-
'Too many assertion calls ({{ count }}). Maximum allowed is {{ max }}.',
19+
'Too many assertion calls ({{ count }}) - maximum allowed is {{ max }}',
2020
},
2121
type: 'suggestion',
2222
schema: [

src/rules/max-nested-describe.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default createRule({
1111
},
1212
messages: {
1313
exceededMaxDepth:
14-
'Too many nested describe calls ({{ depth }}). Maximum allowed is {{ max }}.',
14+
'Too many nested describe calls ({{ depth }}) - maximum allowed is {{ max }}',
1515
},
1616
type: 'suggestion',
1717
schema: [

src/rules/no-export.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default createRule({
1010
recommended: 'error',
1111
},
1212
messages: {
13-
unexpectedExport: `Do not export from a test file.`,
13+
unexpectedExport: `Do not export from a test file`,
1414
},
1515
type: 'suggestion',
1616
schema: [],

src/rules/no-focused-tests.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export default createRule({
1010
recommended: 'error',
1111
},
1212
messages: {
13-
focusedTest: 'Unexpected focused test.',
14-
suggestRemoveFocus: 'Remove focus from test.',
13+
focusedTest: 'Unexpected focused test',
14+
suggestRemoveFocus: 'Remove focus from test',
1515
},
1616
schema: [],
1717
type: 'suggestion',

src/rules/no-identical-title.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ export default createRule({
2727
},
2828
messages: {
2929
multipleTestTitle:
30-
'Test title is used multiple times in the same describe block.',
30+
'Test title is used multiple times in the same describe block',
3131
multipleDescribeTitle:
32-
'Describe block title is used multiple times in the same describe block.',
32+
'Describe block title is used multiple times in the same describe block',
3333
},
3434
schema: [],
3535
type: 'suggestion',

src/rules/no-if.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default createRule({
4343
recommended: false,
4444
},
4545
messages: {
46-
conditionalInTest: 'Test should not contain {{ condition }} statements.',
46+
conditionalInTest: 'Test should not contain {{ condition }} statements',
4747
},
4848
deprecated: true,
4949
replacedBy: ['no-conditional-in-test'],

src/rules/no-mocks-import.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default createRule({
2222
recommended: 'error',
2323
},
2424
messages: {
25-
noManualImport: `Mocks should not be manually imported from a ${mocksDirName} directory. Instead use \`jest.mock\` and import from the original module path.`,
25+
noManualImport: `Mocks should not be manually imported from a ${mocksDirName} directory. Instead use \`jest.mock\` and import from the original module path`,
2626
},
2727
schema: [],
2828
},

src/rules/no-standalone-expect.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default createRule<
6565
recommended: 'error',
6666
},
6767
messages: {
68-
unexpectedExpect: 'Expect must be inside of a test block.',
68+
unexpectedExpect: 'Expect must be inside of a test block',
6969
},
7070
type: 'suggestion',
7171
schema: [

src/rules/no-test-return-statement.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default createRule({
2929
recommended: false,
3030
},
3131
messages: {
32-
noReturnValue: 'Jest tests should not return a value.',
32+
noReturnValue: 'Jest tests should not return a value',
3333
},
3434
schema: [],
3535
type: 'suggestion',

src/rules/prefer-expect-resolves.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default createRule({
1212
},
1313
fixable: 'code',
1414
messages: {
15-
expectResolves: 'Use `await expect(...).resolves instead.',
15+
expectResolves: 'Use `await expect(...).resolves instead',
1616
},
1717
schema: [],
1818
type: 'suggestion',

src/rules/prefer-spy-on.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export default createRule({
7373
recommended: false,
7474
},
7575
messages: {
76-
useJestSpyOn: 'Use jest.spyOn() instead.',
76+
useJestSpyOn: 'Use jest.spyOn() instead',
7777
},
7878
fixable: 'code',
7979
schema: [],

src/rules/valid-expect.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ export default createRule<[Options], MessageIds>({
120120
recommended: 'error',
121121
},
122122
messages: {
123-
tooManyArgs: 'Expect takes at most {{ amount }} argument{{ s }}.',
124-
notEnoughArgs: 'Expect requires at least {{ amount }} argument{{ s }}.',
125-
modifierUnknown: 'Expect has an unknown modifier.',
126-
matcherNotFound: 'Expect must have a corresponding matcher call.',
127-
matcherNotCalled: 'Matchers must be called to assert.',
128-
asyncMustBeAwaited: 'Async assertions must be awaited{{ orReturned }}.',
123+
tooManyArgs: 'Expect takes at most {{ amount }} argument{{ s }}',
124+
notEnoughArgs: 'Expect requires at least {{ amount }} argument{{ s }}',
125+
modifierUnknown: 'Expect has an unknown modifier',
126+
matcherNotFound: 'Expect must have a corresponding matcher call',
127+
matcherNotCalled: 'Matchers must be called to assert',
128+
asyncMustBeAwaited: 'Async assertions must be awaited{{ orReturned }}',
129129
promisesWithAsyncAssertionsMustBeAwaited:
130-
'Promises which return async assertions must be awaited{{ orReturned }}.',
130+
'Promises which return async assertions must be awaited{{ orReturned }}',
131131
},
132132
type: 'suggestion',
133133
schema: [

src/rules/valid-title.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default createRule<[Options], MessageIds>({
122122
emptyTitle: '{{ jestFunctionName }} should not have an empty title',
123123
duplicatePrefix: 'should not have duplicate prefix',
124124
accidentalSpace: 'should not have leading or trailing spaces',
125-
disallowedWord: '"{{ word }}" is not allowed in test titles.',
125+
disallowedWord: '"{{ word }}" is not allowed in test titles',
126126
mustNotMatch: '{{ jestFunctionName }} should not match {{ pattern }}',
127127
mustMatch: '{{ jestFunctionName }} should match {{ pattern }}',
128128
mustNotMatchCustom: '{{ message }}',

0 commit comments

Comments
 (0)