Skip to content

Commit 3136a1d

Browse files
committed
Fix tests
1 parent a1aafd5 commit 3136a1d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/wrangler/src/__tests__/config/configuration.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)