Skip to content

Commit 4a13f44

Browse files
committed
Create commandHandlers.class.test.js
1 parent 9472bfc commit 4a13f44

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import Command from "../../src/lib/commandHandlers.class.js";
2+
3+
test('Create a command with options', () => {
4+
expect(
5+
Command.make('test', {
6+
"categories": ["accessibility", "seo"],
7+
"consoleLog": false
8+
})
9+
).toStrictEqual({
10+
commandToRun: 'lighthouse test --only-categories=accessibility,seo --output json --disable-full-page-screenshot --chrome-flags="--no-sandbox --headless --disable-gpu"',
11+
currentFlags: '--only-categories=accessibility,seo --output json --disable-full-page-screenshot --chrome-flags="--no-sandbox --headless --disable-gpu"'
12+
});
13+
});
14+
15+
test('Create a command without options', () => {
16+
expect(
17+
Command.make('test')
18+
).toStrictEqual({
19+
commandToRun: 'lighthouse test --only-categories=accessibility --output json --disable-full-page-screenshot --chrome-flags="--no-sandbox --headless --disable-gpu"',
20+
currentFlags: '--only-categories=accessibility --output json --disable-full-page-screenshot --chrome-flags="--no-sandbox --headless --disable-gpu"'
21+
});
22+
});

0 commit comments

Comments
 (0)