-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathempty-rules.test.ts
30 lines (26 loc) · 956 Bytes
/
empty-rules.test.ts
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
import postcss from 'postcss';
import postcssRTLCSS from '../src';
import { PluginOptions } from '../src/@types';
import {
readCSSFile,
runTests,
createSnapshotFileName
} from './utils';
import 'jest-specific-snapshot';
const BASE_NAME = 'empty-rules';
runTests({}, (pluginOptions: PluginOptions): void => {
describe(`[[Mode: ${pluginOptions.mode}]] Empty Rules Tests: `, () => {
let input = '';
beforeEach(async (): Promise<void> => {
input = input || await readCSSFile('empty-rules.css');
});
it('Basic', (): void => {
const options: PluginOptions = { ...pluginOptions };
const output = postcss([postcssRTLCSS(options)]).process(input);
expect(output.css).toMatchSpecificSnapshot(
createSnapshotFileName(BASE_NAME,'basic', pluginOptions.mode)
);
expect(output.warnings()).toHaveLength(0);
});
});
});