@@ -153,13 +153,87 @@ test('getRepositoryInfo', () => {
153153 assert . equal ( getRepositoryInfoAdapter ( 'https://github.com' ) , undefined ) ;
154154 assert . equal ( getRepositoryInfoAdapter ( 'https://gist.github.com/' ) , undefined ) ;
155155 assert . equal ( getRepositoryInfoAdapter ( 'https://github.com/settings/developers' ) , undefined ) ;
156- expect ( getRepositoryInfoAdapter ( 'https://github.com/refined-github/github-url-detection' ) ) . toMatchSnapshot ( ) ;
157- expect ( getRepositoryInfoAdapter ( 'https://github.com/refined-github/github-url-detection/' ) ) . toMatchSnapshot ( ) ;
158- expect ( getRepositoryInfoAdapter ( 'https://github.com/refined-github/github-url-detection/blame/master/package.json' ) ) . toMatchSnapshot ( ) ;
159- expect ( getRepositoryInfoAdapter ( 'https://github.com/refined-github/github-url-detection/commit/57bf4' ) ) . toMatchSnapshot ( ) ;
160- expect ( getRepositoryInfoAdapter ( 'https://github.com/refined-github/github-url-detection/compare/test-branch?quick_pull=0' ) ) . toMatchSnapshot ( ) ;
161- expect ( getRepositoryInfoAdapter ( 'https://github.com/refined-github/github-url-detection/tree/master/distribution' ) ) . toMatchSnapshot ( ) ;
162- expect ( getRepositoryInfoAdapter ( 'https://github.com/refined-github/github-url-detection/tree/master/distribution/' ) ) . toMatchSnapshot ( ) ;
156+ expect ( getRepositoryInfoAdapter ( 'https://github.com/refined-github/github-url-detection' ) ) . toMatchInlineSnapshot ( `
157+ {
158+ "name": "github-url-detection",
159+ "nameWithOwner": "refined-github/github-url-detection",
160+ "owner": "refined-github",
161+ "path": "",
162+ "pathParts": [],
163+ }
164+ ` ) ;
165+ expect ( getRepositoryInfoAdapter ( 'https://github.com/refined-github/github-url-detection/' ) ) . toMatchInlineSnapshot ( `
166+ {
167+ "name": "github-url-detection",
168+ "nameWithOwner": "refined-github/github-url-detection",
169+ "owner": "refined-github",
170+ "path": "",
171+ "pathParts": [],
172+ }
173+ ` ) ;
174+ expect ( getRepositoryInfoAdapter ( 'https://github.com/refined-github/github-url-detection/blame/master/package.json' ) ) . toMatchInlineSnapshot ( `
175+ {
176+ "name": "github-url-detection",
177+ "nameWithOwner": "refined-github/github-url-detection",
178+ "owner": "refined-github",
179+ "path": "blame/master/package.json",
180+ "pathParts": [
181+ "blame",
182+ "master",
183+ "package.json",
184+ ],
185+ }
186+ ` ) ;
187+ expect ( getRepositoryInfoAdapter ( 'https://github.com/refined-github/github-url-detection/commit/57bf4' ) ) . toMatchInlineSnapshot ( `
188+ {
189+ "name": "github-url-detection",
190+ "nameWithOwner": "refined-github/github-url-detection",
191+ "owner": "refined-github",
192+ "path": "commit/57bf4",
193+ "pathParts": [
194+ "commit",
195+ "57bf4",
196+ ],
197+ }
198+ ` ) ;
199+ expect ( getRepositoryInfoAdapter ( 'https://github.com/refined-github/github-url-detection/compare/test-branch?quick_pull=0' ) ) . toMatchInlineSnapshot ( `
200+ {
201+ "name": "github-url-detection",
202+ "nameWithOwner": "refined-github/github-url-detection",
203+ "owner": "refined-github",
204+ "path": "compare/test-branch",
205+ "pathParts": [
206+ "compare",
207+ "test-branch",
208+ ],
209+ }
210+ ` ) ;
211+ expect ( getRepositoryInfoAdapter ( 'https://github.com/refined-github/github-url-detection/tree/master/distribution' ) ) . toMatchInlineSnapshot ( `
212+ {
213+ "name": "github-url-detection",
214+ "nameWithOwner": "refined-github/github-url-detection",
215+ "owner": "refined-github",
216+ "path": "tree/master/distribution",
217+ "pathParts": [
218+ "tree",
219+ "master",
220+ "distribution",
221+ ],
222+ }
223+ ` ) ;
224+ expect ( getRepositoryInfoAdapter ( 'https://github.com/refined-github/github-url-detection/tree/master/distribution/' ) ) . toMatchInlineSnapshot ( `
225+ {
226+ "name": "github-url-detection",
227+ "nameWithOwner": "refined-github/github-url-detection",
228+ "owner": "refined-github",
229+ "path": "tree/master/distribution",
230+ "pathParts": [
231+ "tree",
232+ "master",
233+ "distribution",
234+ ],
235+ }
236+ ` ) ;
163237 }
164238} ) ;
165239
0 commit comments