File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ services:
88 working_dir : /home/package
99 environment :
1010 - MEILISEARCH_HOST=http://meilisearch:7700
11- - MEILISEARCH_PORT=7700
1211 depends_on :
1312 - meilisearch
1413 links :
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {
1313 config ,
1414 MeiliSearch ,
1515 BAD_HOST ,
16+ HOST ,
1617} from './meilisearch-test-utils'
1718
1819const indexNoPk = {
@@ -134,15 +135,17 @@ describe.each([
134135 } )
135136
136137 test ( `${ permission } key: host without HTTP should not throw Invalid URL Error` , async ( ) => {
137- const client = new MeiliSearch ( { host : 'meilisearch:7700' } )
138- const health = await client . isHealthy ( )
139- expect ( health ) . toBe ( false )
138+ const strippedHost = HOST . replace ( 'http://' , '' )
139+ expect ( ( ) => {
140+ new MeiliSearch ( { host : strippedHost } )
141+ } ) . not . toThrow ( 'The provided host is not valid.' )
140142 } )
141143
142144 test ( `${ permission } key: host without HTTP and port should not throw Invalid URL Error` , async ( ) => {
143- const client = new MeiliSearch ( { host : 'meilisearch' } )
144- const health = await client . isHealthy ( )
145- expect ( health ) . toBe ( false )
145+ const strippedHost = HOST . replace ( 'http://' , '' ) . replace ( ':7700' , '' )
146+ expect ( ( ) => {
147+ new MeiliSearch ( { host : strippedHost } )
148+ } ) . not . toThrow ( 'The provided host is not valid.' )
146149 } )
147150
148151 test ( `${ permission } key: Empty string host should throw an error` , ( ) => {
You can’t perform that action at this time.
0 commit comments