Skip to content

Commit fcf2854

Browse files
prettier check
1 parent a86b849 commit fcf2854

File tree

1 file changed

+76
-76
lines changed

1 file changed

+76
-76
lines changed

test/features/newline.js

Lines changed: 76 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,76 @@
1-
import dedent from 'dedent-js';
2-
3-
/**
4-
* Tests support for all newline options
5-
* @param {Function} format
6-
*/
7-
export default function supportsNewlineOptions(format) {
8-
it('supports always mode', () => {
9-
const result = format('SELECT foo, bar, baz FROM qux;', {
10-
newline: { mode: 'always' },
11-
});
12-
expect(result).toBe(dedent`
13-
SELECT
14-
foo,
15-
bar,
16-
baz
17-
FROM
18-
qux;
19-
`);
20-
});
21-
22-
it('supports never mode', () => {
23-
const result = format('SELECT foo, bar, baz, qux FROM corge;', { newline: { mode: 'never' } });
24-
expect(result).toBe(dedent`
25-
SELECT foo, bar, baz, qux
26-
FROM corge;
27-
`);
28-
});
29-
30-
it('supports itemCount mode', () => {
31-
const result = format('SELECT foo, bar, baz, qux FROM corge;', {
32-
newline: { mode: 'itemCount', itemCount: 3 },
33-
});
34-
expect(result).toBe(dedent`
35-
SELECT
36-
foo,
37-
bar,
38-
baz,
39-
qux
40-
FROM corge;
41-
`);
42-
});
43-
44-
it('supports lineWidth mode', () => {
45-
const result = format('SELECT foo, bar, baz, qux FROM corge;', {
46-
newline: { mode: 'lineWidth' },
47-
lineWidth: 20,
48-
});
49-
expect(result).toBe(dedent`
50-
SELECT
51-
foo,
52-
bar,
53-
baz,
54-
qux
55-
FROM corge;
56-
`);
57-
});
58-
59-
it('supports hybrid mode', () => {
60-
const result = format('SELECT verylongfoo, verylongbar FROM baz GROUP BY foo, bar, baz, qux;', {
61-
newline: { mode: 'hybrid', itemCount: 2 },
62-
lineWidth: 30,
63-
});
64-
expect(result).toBe(dedent`
65-
SELECT
66-
verylongfoo,
67-
verylongbar
68-
FROM baz
69-
GROUP BY
70-
foo,
71-
bar,
72-
baz,
73-
qux;
74-
`);
75-
});
76-
}
1+
import dedent from 'dedent-js';
2+
3+
/**
4+
* Tests support for all newline options
5+
* @param {Function} format
6+
*/
7+
export default function supportsNewlineOptions(format) {
8+
it('supports always mode', () => {
9+
const result = format('SELECT foo, bar, baz FROM qux;', {
10+
newline: { mode: 'always' },
11+
});
12+
expect(result).toBe(dedent`
13+
SELECT
14+
foo,
15+
bar,
16+
baz
17+
FROM
18+
qux;
19+
`);
20+
});
21+
22+
it('supports never mode', () => {
23+
const result = format('SELECT foo, bar, baz, qux FROM corge;', { newline: { mode: 'never' } });
24+
expect(result).toBe(dedent`
25+
SELECT foo, bar, baz, qux
26+
FROM corge;
27+
`);
28+
});
29+
30+
it('supports itemCount mode', () => {
31+
const result = format('SELECT foo, bar, baz, qux FROM corge;', {
32+
newline: { mode: 'itemCount', itemCount: 3 },
33+
});
34+
expect(result).toBe(dedent`
35+
SELECT
36+
foo,
37+
bar,
38+
baz,
39+
qux
40+
FROM corge;
41+
`);
42+
});
43+
44+
it('supports lineWidth mode', () => {
45+
const result = format('SELECT foo, bar, baz, qux FROM corge;', {
46+
newline: { mode: 'lineWidth' },
47+
lineWidth: 20,
48+
});
49+
expect(result).toBe(dedent`
50+
SELECT
51+
foo,
52+
bar,
53+
baz,
54+
qux
55+
FROM corge;
56+
`);
57+
});
58+
59+
it('supports hybrid mode', () => {
60+
const result = format('SELECT verylongfoo, verylongbar FROM baz GROUP BY foo, bar, baz, qux;', {
61+
newline: { mode: 'hybrid', itemCount: 2 },
62+
lineWidth: 30,
63+
});
64+
expect(result).toBe(dedent`
65+
SELECT
66+
verylongfoo,
67+
verylongbar
68+
FROM baz
69+
GROUP BY
70+
foo,
71+
bar,
72+
baz,
73+
qux;
74+
`);
75+
});
76+
}

0 commit comments

Comments
 (0)