Skip to content

Commit b983084

Browse files
committed
Fix code style
1 parent 028e89e commit b983084

File tree

3 files changed

+74
-70
lines changed

3 files changed

+74
-70
lines changed

jest/customMatchers.js

+67-67
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,30 @@ expect.extend({
2626

2727
const message = pass
2828
? () => {
29-
return (
30-
this.utils.matcherHint('toMatchCss', undefined, undefined, options) +
31-
'\n\n' +
32-
`Expected: not ${this.utils.printExpected(format(received))}\n` +
33-
`Received: ${this.utils.printReceived(format(argument))}`
34-
)
35-
}
29+
return (
30+
this.utils.matcherHint('toMatchCss', undefined, undefined, options) +
31+
'\n\n' +
32+
`Expected: not ${this.utils.printExpected(format(received))}\n` +
33+
`Received: ${this.utils.printReceived(format(argument))}`
34+
)
35+
}
3636
: () => {
37-
const actual = format(received)
38-
const expected = format(argument)
39-
40-
const diffString = diff(expected, actual, {
41-
expand: this.expand,
42-
})
43-
44-
return (
45-
this.utils.matcherHint('toMatchCss', undefined, undefined, options) +
46-
'\n\n' +
47-
(diffString && diffString.includes('- Expect')
48-
? `Difference:\n\n${diffString}`
49-
: `Expected: ${this.utils.printExpected(expected)}\n` +
50-
`Received: ${this.utils.printReceived(actual)}`)
51-
)
52-
}
37+
const actual = format(received)
38+
const expected = format(argument)
39+
40+
const diffString = diff(expected, actual, {
41+
expand: this.expand,
42+
})
43+
44+
return (
45+
this.utils.matcherHint('toMatchCss', undefined, undefined, options) +
46+
'\n\n' +
47+
(diffString && diffString.includes('- Expect')
48+
? `Difference:\n\n${diffString}`
49+
: `Expected: ${this.utils.printExpected(expected)}\n` +
50+
`Received: ${this.utils.printReceived(actual)}`)
51+
)
52+
}
5353

5454
return { actual: received, message, pass }
5555
},
@@ -67,27 +67,27 @@ expect.extend({
6767

6868
const message = pass
6969
? () => {
70-
return (
71-
this.utils.matcherHint('toIncludeCss', undefined, undefined, options) +
72-
'\n\n' +
73-
`Expected: not ${this.utils.printExpected(format(received))}\n` +
74-
`Received: ${this.utils.printReceived(format(argument))}`
75-
)
76-
}
70+
return (
71+
this.utils.matcherHint('toIncludeCss', undefined, undefined, options) +
72+
'\n\n' +
73+
`Expected: not ${this.utils.printExpected(format(received))}\n` +
74+
`Received: ${this.utils.printReceived(format(argument))}`
75+
)
76+
}
7777
: () => {
78-
const diffString = diff(expected, actual, {
79-
expand: this.expand,
80-
})
81-
82-
return (
83-
this.utils.matcherHint('toIncludeCss', undefined, undefined, options) +
84-
'\n\n' +
85-
(diffString && diffString.includes('- Expect')
86-
? `Difference:\n\n${diffString}`
87-
: `Expected: ${this.utils.printExpected(expected)}\n` +
88-
`Received: ${this.utils.printReceived(actual)}`)
89-
)
90-
}
78+
const diffString = diff(expected, actual, {
79+
expand: this.expand,
80+
})
81+
82+
return (
83+
this.utils.matcherHint('toIncludeCss', undefined, undefined, options) +
84+
'\n\n' +
85+
(diffString && diffString.includes('- Expect')
86+
? `Difference:\n\n${diffString}`
87+
: `Expected: ${this.utils.printExpected(expected)}\n` +
88+
`Received: ${this.utils.printReceived(actual)}`)
89+
)
90+
}
9191

9292
return { actual: received, message, pass }
9393
},
@@ -116,31 +116,31 @@ expect.extend({
116116

117117
const message = pass
118118
? () => {
119-
return (
120-
this.utils.matcherHint('toMatchCss', undefined, undefined, options) +
121-
'\n\n' +
122-
`Expected: not ${this.utils.printExpected(formattedReceived)}\n` +
123-
`Received: ${this.utils.printReceived(formattedArgument)}`
124-
)
125-
}
119+
return (
120+
this.utils.matcherHint('toMatchCss', undefined, undefined, options) +
121+
'\n\n' +
122+
`Expected: not ${this.utils.printExpected(formattedReceived)}\n` +
123+
`Received: ${this.utils.printReceived(formattedArgument)}`
124+
)
125+
}
126126
: () => {
127-
const actual = formattedReceived
128-
const expected = formattedArgument
129-
130-
const diffString = diff(expected, actual, {
131-
expand: this.expand,
132-
})
133-
134-
return (
135-
this.utils.matcherHint('toMatchCss', undefined, undefined, options) +
136-
'\n\n' +
137-
(diffString && diffString.includes('- Expect')
138-
? `Difference:\n\n${diffString}`
139-
: `Expected: ${this.utils.printExpected(expected)}\n` +
140-
`Received: ${this.utils.printReceived(actual)}`)
141-
)
142-
}
127+
const actual = formattedReceived
128+
const expected = formattedArgument
129+
130+
const diffString = diff(expected, actual, {
131+
expand: this.expand,
132+
})
133+
134+
return (
135+
this.utils.matcherHint('toMatchCss', undefined, undefined, options) +
136+
'\n\n' +
137+
(diffString && diffString.includes('- Expect')
138+
? `Difference:\n\n${diffString}`
139+
: `Expected: ${this.utils.printExpected(expected)}\n` +
140+
`Received: ${this.utils.printReceived(actual)}`)
141+
)
142+
}
143143

144144
return { actual: received, message, pass }
145145
},
146-
})
146+
})

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const lineClamp = plugin(
1515
'line-clamp': (value) => ({
1616
...baseStyles,
1717
'-webkit-line-clamp': `${value}`,
18-
})
18+
}),
1919
},
2020
{ values }
2121
)

src/index.test.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ function run(config, plugin = tailwindcss) {
1717

1818
it('should add the `line-clamp-{n}` components', () => {
1919
const config = {
20-
content: [{ raw: String.raw`<div class="line-clamp-2 line-clamp-[33] line-clamp-[var(--line-clamp-variable)]"></div>` }],
20+
content: [
21+
{
22+
raw: String.raw`<div class="line-clamp-2 line-clamp-[33] line-clamp-[var(--line-clamp-variable)]"></div>`,
23+
},
24+
],
2125
}
2226

2327
return run(config).then((result) => {
@@ -58,4 +62,4 @@ it('should add the `line-clamp-none` utility', () => {
5862
}
5963
`)
6064
})
61-
})
65+
})

0 commit comments

Comments
 (0)