@@ -28,9 +28,9 @@ describe("readConfig()", () => {
2828 writeWranglerConfig ( {
2929 main : "index.py" ,
3030 } ) ;
31- await expect (
31+ await expect ( ( ) =>
3232 readConfig ( { config : "wrangler.toml" } )
33- ) . rejects . toMatchInlineSnapshot (
33+ ) . toThrowErrorMatchingInlineSnapshot (
3434 `[Error: The \`python_workers\` compatibility flag is required to use Python.]`
3535 ) ;
3636 } ) ;
@@ -137,7 +137,7 @@ compatibility_date = "2022-01-12"`;
137137 const configContent = Buffer . from ( '{"name": "test"}' , "utf-8" ) ;
138138 fs . writeFileSync ( "wrangler.json" , Buffer . concat ( [ bomBytes , configContent ] ) ) ;
139139
140- await expect ( readConfig ( { config : "wrangler.json" } ) ) . rejects . toThrow (
140+ await expect ( ( ) => readConfig ( { config : "wrangler.json" } ) ) . toThrow (
141141 "Configuration file contains UTF-16 BE byte order marker"
142142 ) ;
143143 } ) ;
@@ -147,7 +147,7 @@ compatibility_date = "2022-01-12"`;
147147 const configContent = Buffer . from ( '{"name": "test"}' , "utf-8" ) ;
148148 fs . writeFileSync ( "wrangler.json" , Buffer . concat ( [ bomBytes , configContent ] ) ) ;
149149
150- await expect ( readConfig ( { config : "wrangler.json" } ) ) . rejects . toThrow (
150+ await expect ( ( ) => readConfig ( { config : "wrangler.json" } ) ) . toThrow (
151151 "Configuration file contains UTF-16 LE byte order marker"
152152 ) ;
153153 } ) ;
@@ -157,7 +157,7 @@ compatibility_date = "2022-01-12"`;
157157 const configContent = Buffer . from ( '{"name": "test"}' , "utf-8" ) ;
158158 fs . writeFileSync ( "wrangler.json" , Buffer . concat ( [ bomBytes , configContent ] ) ) ;
159159
160- await expect ( readConfig ( { config : "wrangler.json" } ) ) . rejects . toThrow (
160+ await expect ( ( ) => readConfig ( { config : "wrangler.json" } ) ) . toThrow (
161161 "Configuration file contains UTF-32 BE byte order marker"
162162 ) ;
163163 } ) ;
@@ -167,7 +167,7 @@ compatibility_date = "2022-01-12"`;
167167 const configContent = Buffer . from ( '{"name": "test"}' , "utf-8" ) ;
168168 fs . writeFileSync ( "wrangler.json" , Buffer . concat ( [ bomBytes , configContent ] ) ) ;
169169
170- await expect ( readConfig ( { config : "wrangler.json" } ) ) . rejects . toThrow (
170+ await expect ( ( ) => readConfig ( { config : "wrangler.json" } ) ) . toThrow (
171171 "Configuration file contains UTF-32 LE byte order marker"
172172 ) ;
173173 } ) ;
0 commit comments