1- import { expect , test , describe , beforeEach , vi } from ' vitest' ;
2- import { MeiliSearch } from ' ./utils/meilisearch-test-utils' ;
1+ import { expect , test , describe , beforeEach , vi } from " vitest" ;
2+ import { MeiliSearch } from " ./utils/meilisearch-test-utils" ;
33import {
44 MeiliSearchError ,
55 MeiliSearchApiError ,
66 MeiliSearchRequestError ,
77 MeiliSearchTimeOutError ,
8- } from ' ../src/errors' ;
8+ } from " ../src/errors" ;
99
1010const mockedFetch = vi . fn ( ) ;
1111globalThis . fetch = mockedFetch ;
1212
13- describe ( ' Test on updates' , ( ) => {
13+ describe ( " Test on updates" , ( ) => {
1414 beforeEach ( ( ) => {
1515 mockedFetch . mockReset ( ) ;
1616 } ) ;
1717
1818 test ( `Throw MeilisearchRequestError when throwned error is not MeiliSearchApiError` , async ( ) => {
19- mockedFetch . mockRejectedValue ( new Error ( ' fake error message' ) ) ;
19+ mockedFetch . mockRejectedValue ( new Error ( " fake error message" ) ) ;
2020
21- const client = new MeiliSearch ( { host : ' http://localhost:9345' } ) ;
21+ const client = new MeiliSearch ( { host : " http://localhost:9345" } ) ;
2222 try {
2323 await client . health ( ) ;
2424 } catch ( error ) {
25- expect ( error . name ) . toEqual ( ' MeiliSearchRequestError' ) ;
25+ expect ( error . name ) . toEqual ( " MeiliSearchRequestError" ) ;
2626 }
2727 } ) ;
2828
@@ -37,26 +37,26 @@ describe('Test on updates', () => {
3737 ) . toEqual ( true ) ;
3838 } ) ;
3939
40- test ( ' MeilisearchRequestError can be compared with the instanceof operator' , async ( ) => {
41- mockedFetch . mockRejectedValue ( new Error ( ' fake error message' ) ) ;
40+ test ( " MeilisearchRequestError can be compared with the instanceof operator" , async ( ) => {
41+ mockedFetch . mockRejectedValue ( new Error ( " fake error message" ) ) ;
4242
43- const client = new MeiliSearch ( { host : ' http://localhost:9345' } ) ;
43+ const client = new MeiliSearch ( { host : " http://localhost:9345" } ) ;
4444 try {
4545 await client . health ( ) ;
4646 } catch ( error ) {
4747 expect ( error instanceof MeiliSearchRequestError ) . toEqual ( true ) ;
4848 }
4949 } ) ;
5050
51- test ( ' MeiliSearchError can be compared with the instanceof operator' , ( ) => {
52- expect ( new MeiliSearchError ( ' message' ) instanceof MeiliSearchError ) . toEqual (
51+ test ( " MeiliSearchError can be compared with the instanceof operator" , ( ) => {
52+ expect ( new MeiliSearchError ( " message" ) instanceof MeiliSearchError ) . toEqual (
5353 true ,
5454 ) ;
5555 } ) ;
5656
57- test ( ' MeiliSearchTimeOutError can be compared with the instanceof operator' , ( ) => {
57+ test ( " MeiliSearchTimeOutError can be compared with the instanceof operator" , ( ) => {
5858 expect (
59- new MeiliSearchTimeOutError ( ' message' ) instanceof MeiliSearchTimeOutError ,
59+ new MeiliSearchTimeOutError ( " message" ) instanceof MeiliSearchTimeOutError ,
6060 ) . toEqual ( true ) ;
6161 } ) ;
6262} ) ;
0 commit comments