File tree 3 files changed +26
-0
lines changed
3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ script:
15
15
- npm run demo5
16
16
- npm run demo6
17
17
- npm run demo7
18
+ # hmm why are some demos skipped?
19
+ - npm run demo11
18
20
- START_SERVER_AND_TEST_INSECURE=1 npm run demo9
19
21
- npm run demo-cross-env
20
22
- npm run demo-commands
Original file line number Diff line number Diff line change @@ -83,6 +83,22 @@ describe('utils', () => {
83
83
la ( isUrlOrPort ( 'http://foo.com' ) )
84
84
la ( isUrlOrPort ( 'http://foo.com/bar/baz.html' ) )
85
85
la ( isUrlOrPort ( 'http://localhost:6000' ) )
86
+ la ( isUrlOrPort ( 'https://google.com' ) )
87
+ } )
88
+
89
+ it ( 'allows url with http-get' , ( ) => {
90
+ la ( isUrlOrPort ( 'http-get://localhost' ) )
91
+ la ( isUrlOrPort ( 'http-get://foo.com' ) )
92
+ la ( isUrlOrPort ( 'http-get://foo.com/bar/baz.html' ) )
93
+ la ( isUrlOrPort ( 'http-get://localhost:6000' ) )
94
+ } )
95
+
96
+ it ( 'allows url with https-head' , ( ) => {
97
+ la ( isUrlOrPort ( 'https-head://localhost:6000' ) )
98
+ } )
99
+
100
+ it ( 'allows url with https-options' , ( ) => {
101
+ la ( isUrlOrPort ( 'https-head://foo' ) )
86
102
} )
87
103
88
104
it ( 'allows port number or string' , ( ) => {
Original file line number Diff line number Diff line change @@ -73,13 +73,21 @@ const isPackageScriptName = command => {
73
73
return Boolean ( packageJson . scripts [ command ] )
74
74
}
75
75
76
+ const isWaitOnUrl = s => / ^ h t t p s ? - (?: g e t | h e a d | o p t i o n s ) / . test ( s )
77
+
76
78
const isUrlOrPort = input => {
77
79
const str = is . string ( input ) ? input . split ( '|' ) : [ input ]
78
80
79
81
return str . every ( s => {
80
82
if ( is . url ( s ) ) {
81
83
return s
82
84
}
85
+ // wait-on allows specifying HTTP verb to use instead of default HEAD
86
+ // and the format then is like "http-get://domain.com" to use GET
87
+ if ( isWaitOnUrl ( s ) ) {
88
+ return s
89
+ }
90
+
83
91
if ( is . number ( s ) ) {
84
92
return is . port ( s )
85
93
}
You can’t perform that action at this time.
0 commit comments