File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -89,4 +89,4 @@ export const optionsToParameterizedUrl = (options: Object) => {
8989} ;
9090
9191export const gitHubToSandboxUrl = ( githubUrl : string ) =>
92- githubUrl . replace ( ' https:// github.com' , '/s/github' ) ;
92+ githubUrl . replace ( / h t t p s ? : \/ \/ ( w w w . ) ? g i t h u b .c o m / , '/s/github' ) ;
Original file line number Diff line number Diff line change 1+ import { gitHubToSandboxUrl } from './url-generator' ;
2+
3+ describe ( 'url-generator' , ( ) => {
4+ describe ( 'gitHubToSandboxUrl' , ( ) => {
5+ [
6+ 'http://github.com/user/repo' ,
7+ 'http://www.github.com/user/repo' ,
8+ 'https://github.com/user/repo' ,
9+ 'https://www.github.com/user/repo'
10+ ] . forEach ( inputUrl => {
11+ test ( `handles ${ inputUrl } urls` , ( ) => {
12+ expect ( gitHubToSandboxUrl ( inputUrl ) ) . toBe ( '/s/github/user/repo' ) ;
13+ } ) ;
14+ } )
15+ } ) ;
16+ } ) ;
You can’t perform that action at this time.
0 commit comments