File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -186,6 +186,7 @@ collect.set('isPRCommit', [
186
186
] ) ;
187
187
188
188
export const isPRCommit404 = ( ) : boolean => isPRCommit ( ) && document . title . startsWith ( 'Commit range not found · Pull Request' ) ;
189
+ export const isPRFile404 = ( ) : boolean => isPRFiles ( ) && document . title . startsWith ( 'Commit range not found · Pull Request' ) ;
189
190
190
191
export const isPRConversation = ( url : URL | Location = location ) : boolean => / ^ p u l l \/ \d + $ / . test ( getRepoPath ( url ) ! ) ;
191
192
collect . set ( 'isPRConversation' , [
Original file line number Diff line number Diff line change @@ -111,6 +111,16 @@ test('isPRCommit404', t => {
111
111
t . false ( pageDetect . isPRCommit404 ( ) ) ;
112
112
} ) ;
113
113
114
+ test ( 'isPRFile404' , t => {
115
+ document . title = 'Commit range not found · Pull Request #789 · sindresorhus/eslint-plugin-unicorn' ;
116
+ location . href = 'https://github.com/sindresorhus/eslint-plugin-unicorn/pull/789/files/a58b37845f1b2660221de019e4ae6c736feedc26..eed168224d7994652b1d1ff69a5c8cebee223faf' ;
117
+ t . true ( pageDetect . isPRFile404 ( ) ) ;
118
+
119
+ document . title = 'Add `align-repository-header` feature by fregante · Pull Request #3313 · sindresorhus/refined-github' ;
120
+ location . href = 'https://github.com/sindresorhus/refined-github/pull/3313/files/a14fb2c94eae3ca83a3a97688a171fcc3405524f..fbeeba9825f12b5ded9cd4bb04d5df4b0cf2f2a8' ;
121
+ t . false ( pageDetect . isPRFile404 ( ) ) ;
122
+ } ) ;
123
+
114
124
test ( 'getRepoPath' , t => {
115
125
const pairs = new Map < string , string | undefined > ( [
116
126
[
You can’t perform that action at this time.
0 commit comments