Skip to content

Commit e828ed6

Browse files
committed
Use Error for test errors
1 parent 6639a31 commit e828ed6

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

lib/config-utils.test.js

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/config-utils.test.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/config-utils.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ test("load input outside of workspace", async (t) => {
230230
createFeatures([]),
231231
getRunnerLogger(true)
232232
);
233-
throw new UserError("initConfig did not throw error");
233+
throw new Error("initConfig did not throw error");
234234
} catch (err) {
235235
t.deepEqual(
236236
err,
@@ -271,7 +271,7 @@ test("load non-local input with invalid repo syntax", async (t) => {
271271
createFeatures([]),
272272
getRunnerLogger(true)
273273
);
274-
throw new UserError("initConfig did not throw error");
274+
throw new Error("initConfig did not throw error");
275275
} catch (err) {
276276
t.deepEqual(
277277
err,
@@ -313,7 +313,7 @@ test("load non-existent input", async (t) => {
313313
createFeatures([]),
314314
getRunnerLogger(true)
315315
);
316-
throw new UserError("initConfig did not throw error");
316+
throw new Error("initConfig did not throw error");
317317
} catch (err) {
318318
t.deepEqual(
319319
err,
@@ -1251,7 +1251,7 @@ test("Remote config handles the case where a directory is provided", async (t) =
12511251
createFeatures([]),
12521252
getRunnerLogger(true)
12531253
);
1254-
throw new UserError("initConfig did not throw error");
1254+
throw new Error("initConfig did not throw error");
12551255
} catch (err) {
12561256
t.deepEqual(
12571257
err,
@@ -1293,7 +1293,7 @@ test("Invalid format of remote config handled correctly", async (t) => {
12931293
createFeatures([]),
12941294
getRunnerLogger(true)
12951295
);
1296-
throw new UserError("initConfig did not throw error");
1296+
throw new Error("initConfig did not throw error");
12971297
} catch (err) {
12981298
t.deepEqual(
12991299
err,
@@ -1339,7 +1339,7 @@ test("No detected languages", async (t) => {
13391339
createFeatures([]),
13401340
getRunnerLogger(true)
13411341
);
1342-
throw new UserError("initConfig did not throw error");
1342+
throw new Error("initConfig did not throw error");
13431343
} catch (err) {
13441344
t.deepEqual(err, new UserError(configUtils.getNoLanguagesError()));
13451345
}
@@ -1372,7 +1372,7 @@ test("Unknown languages", async (t) => {
13721372
createFeatures([]),
13731373
getRunnerLogger(true)
13741374
);
1375-
throw new UserError("initConfig did not throw error");
1375+
throw new Error("initConfig did not throw error");
13761376
} catch (err) {
13771377
t.deepEqual(
13781378
err,
@@ -1567,7 +1567,7 @@ function doInvalidInputTest(
15671567
createFeatures([]),
15681568
getRunnerLogger(true)
15691569
);
1570-
throw new UserError("initConfig did not throw error");
1570+
throw new Error("initConfig did not throw error");
15711571
} catch (err) {
15721572
t.deepEqual(
15731573
err,

0 commit comments

Comments
 (0)