Skip to content

Commit 51ff51b

Browse files
committed
Fix lint
1 parent 8cf2a63 commit 51ff51b

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed
Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
11
import postcss from 'postcss';
22
import postcssRTLCSS from '../src';
3-
import { PluginOptions, Mode } from '../src/@types';
3+
import {PluginOptions} from '../src/@types';
44
import {
5-
readCSSFile,
6-
runTests,
7-
createSnapshotFileName
5+
readCSSFile,
6+
runTests,
7+
createSnapshotFileName
88
} from './utils';
99
import 'jest-specific-snapshot';
1010

1111
const BASE_NAME = 'process-declaration-plugins';
1212

1313
runTests({}, (pluginOptions: PluginOptions): void => {
1414

15-
describe(`[[Mode: ${pluginOptions.mode}]]`, (): void => {
15+
describe(`[[Mode: ${pluginOptions.mode}]]`, (): void => {
1616

17-
let input = '';
18-
19-
beforeEach(async (): Promise<void> => {
20-
input = input || await readCSSFile(`input-${BASE_NAME}.scss`);
21-
});
22-
23-
it('flip background by default', (): void => {
24-
const output = postcss([postcssRTLCSS(pluginOptions)]).process(input);
25-
expect(output.css).toMatchSpecificSnapshot(
26-
createSnapshotFileName(BASE_NAME,'flip', pluginOptions.mode)
27-
);
28-
expect(output.warnings()).toHaveLength(0);
29-
});
17+
let input = '';
18+
19+
beforeEach(async (): Promise<void> => {
20+
input = input || await readCSSFile(`input-${BASE_NAME}.scss`);
21+
});
22+
23+
it('flip background by default', (): void => {
24+
const output = postcss([postcssRTLCSS(pluginOptions)]).process(input);
25+
expect(output.css).toMatchSpecificSnapshot(
26+
createSnapshotFileName(BASE_NAME, 'flip', pluginOptions.mode)
27+
);
28+
expect(output.warnings()).toHaveLength(0);
29+
});
30+
31+
it('use {processDeclarationPlugins} to avoid flipping background', (): void => {
32+
const options: PluginOptions = {
33+
...pluginOptions,
34+
processDeclarationPlugins: [{
35+
name: 'avoid-flipping-background',
36+
priority: 99, // above the core RTLCSS plugin which has a priority value of 100
37+
processors: [{
38+
expr: /(background|object)(-position(-x)?|-image)?$/i,
39+
action: (prop: string, value: string) => ({prop, value})
40+
}]
41+
}]
42+
};
43+
const output = postcss([postcssRTLCSS(options)]).process(input);
44+
expect(output.css).toMatchSpecificSnapshot(
45+
createSnapshotFileName(BASE_NAME, 'noflip', pluginOptions.mode)
46+
);
47+
expect(output.warnings()).toHaveLength(0);
48+
});
3049

31-
it('use {processDeclarationPlugins} to avoid flipping background', (): void => {
32-
const options: PluginOptions = {
33-
...pluginOptions,
34-
processDeclarationPlugins: [{
35-
name: 'avoid-flipping-background',
36-
priority: 99, // above the core RTLCSS plugin which has a priority value of 100
37-
processors: [{
38-
expr: /(background|object)(-position(-x)?|-image)?$/i,
39-
action: (prop: string, value: string) => ({prop, value})
40-
}]
41-
}]
42-
};
43-
const output = postcss([postcssRTLCSS(options)]).process(input);
44-
expect(output.css).toMatchSpecificSnapshot(
45-
createSnapshotFileName(BASE_NAME,'noflip', pluginOptions.mode)
46-
);
47-
expect(output.warnings()).toHaveLength(0);
4850
});
49-
50-
});
5151

5252
});

0 commit comments

Comments
 (0)