-
Notifications
You must be signed in to change notification settings - Fork 451
Expand file tree
/
Copy pathinit.test.ts
More file actions
32 lines (28 loc) · 989 Bytes
/
init.test.ts
File metadata and controls
32 lines (28 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import test from "ava";
import { Config } from "./config-utils";
import { printPathFiltersWarning } from "./init";
import { Language } from "./languages";
import { LoggedMessage, getRecordingLogger, setupTests } from "./testing-utils";
setupTests(test);
test("printPathFiltersWarning does not trigger when 'paths' and 'paths-ignore' are undefined", async (t) => {
const messages: LoggedMessage[] = [];
printPathFiltersWarning(
{
languages: [Language.cpp],
originalUserInput: {},
} as Partial<Config> as Config,
getRecordingLogger(messages),
);
t.is(messages.length, 0);
});
test("printPathFiltersWarning does not trigger when 'paths' and 'paths-ignore' are empty", async (t) => {
const messages: LoggedMessage[] = [];
printPathFiltersWarning(
{
languages: [Language.cpp],
originalUserInput: { paths: [], "paths-ignore": [] },
} as Partial<Config> as Config,
getRecordingLogger(messages),
);
t.is(messages.length, 0);
});