-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathoptions.test.js
More file actions
38 lines (33 loc) · 1.65 KB
/
options.test.js
File metadata and controls
38 lines (33 loc) · 1.65 KB
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
33
34
35
36
37
38
import getPrettier from '../../config/get-prettier.js';
import getPlugins from '../../config/get-plugins.js';
const prettier = await getPrettier();
const plugins = await getPlugins();
test('Prettier should report the supported options when multiple plugins are given', async () => {
const supportedOptionsNames = (
await prettier.getSupportInfo({ plugins })
).options.map((option) => option.name);
expect(supportedOptionsNames).toContain('printWidth');
expect(supportedOptionsNames).toContain('tabWidth');
expect(supportedOptionsNames).toContain('useTabs');
expect(supportedOptionsNames).toContain('bracketSpacing');
expect(supportedOptionsNames).toContain('singleQuote');
expect(supportedOptionsNames).toContain('experimentalTernaries');
expect(supportedOptionsNames).toContain('experimentalOperatorPosition');
expect(supportedOptionsNames).toContain('compiler');
});
test('Prettier should report the supported options when a single plugin is given', async () => {
const solidityPlugin = plugins[plugins.length - 1];
const supportedOptionsNames = (
await prettier.getSupportInfo({
plugins: [solidityPlugin]
})
).options.map((option) => option.name);
expect(supportedOptionsNames).toContain('printWidth');
expect(supportedOptionsNames).toContain('tabWidth');
expect(supportedOptionsNames).toContain('useTabs');
expect(supportedOptionsNames).toContain('bracketSpacing');
expect(supportedOptionsNames).toContain('singleQuote');
expect(supportedOptionsNames).toContain('experimentalTernaries');
expect(supportedOptionsNames).toContain('experimentalOperatorPosition');
expect(supportedOptionsNames).toContain('compiler');
});