Skip to content

Commit b839c12

Browse files
committed
UnblockReview: change error message text
1 parent f8ab4e6 commit b839c12

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

UnblockReview/modules/UnblockReview.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class UnblockReview {
9595
matches = [ ...matches ];
9696

9797
if ( matches.length === 0 ) {
98-
throw new Error( 'Searching for target text failed!' );
98+
throw new Error( 'Searching for target text failed' );
9999
}
100100

101101
// Loop through all the potential matches, trying to find an {{Unblock template. If found, return the beginning of the template.

UnblockReview/tests/UnblockReview.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,21 +94,21 @@ describe( 'getLeftHalfOfUnblockTemplate( wikitext, appealReason )', () => {
9494
const wikitext = `No target text`;
9595
const appealReason = `Your reason here `;
9696
expect( () => {unblockReview.getLeftHalfOfUnblockTemplate( wikitext, appealReason );} ).toThrow( Error );
97-
expect( () => {unblockReview.getLeftHalfOfUnblockTemplate( wikitext, appealReason );} ).toThrow( "Searching for target text failed!" );
97+
expect( () => {unblockReview.getLeftHalfOfUnblockTemplate( wikitext, appealReason );} ).toThrow( "Searching for target text failed" );
9898
} );
9999

100100
test( 'No start of template', () => {
101101
const wikitext = `Test Your reason here Test`;
102102
const appealReason = `Your reason here `;
103103
expect( () => {unblockReview.getLeftHalfOfUnblockTemplate( wikitext, appealReason );} ).toThrow( Error );
104-
expect( () => {unblockReview.getLeftHalfOfUnblockTemplate( wikitext, appealReason );} ).toThrow( "Searching backwards failed!" );
104+
expect( () => {unblockReview.getLeftHalfOfUnblockTemplate( wikitext, appealReason );} ).toThrow( "Failed to find left half of unblock template in the wikicode" );
105105
} );
106106

107107
test( 'Skip <nowiki>{{unblock}}', () => {
108108
const wikitext = `Test <code><nowiki>{{unblock|reason=Your reason here ~~~~}}</nowiki></code> Test`;
109109
const appealReason = `Your reason here `;
110110
expect( () => {unblockReview.getLeftHalfOfUnblockTemplate( wikitext, appealReason );} ).toThrow( Error );
111-
expect( () => {unblockReview.getLeftHalfOfUnblockTemplate( wikitext, appealReason );} ).toThrow( "Searching for target text failed!" );
111+
expect( () => {unblockReview.getLeftHalfOfUnblockTemplate( wikitext, appealReason );} ).toThrow( "Searching for target text failed" );
112112
} );
113113

114114
test( '{{AAA}}AAAblock', () => {

0 commit comments

Comments
 (0)