Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 0 additions & 62 deletions tests/__snapshots__/empty-rules.test.ts.snap

This file was deleted.

27 changes: 27 additions & 0 deletions tests/__snapshots__/empty-rules/combined/basic.snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`[[Mode: combined]] Empty Rules Tests: Basic 1`] = `
".test1 {}

.test2, .test3 {}

[dir="ltr"] .test4 {
text-align: left;
}

[dir="rtl"] .test4 {
text-align: right;
}

.test5 {
color: red;
}

[dir="ltr"] .test5 {
padding-left: 20px;
}

[dir="rtl"] .test5 {
padding-right: 20px;
}"
`;
12 changes: 12 additions & 0 deletions tests/__snapshots__/empty-rules/diff/basic.snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`[[Mode: diff]] Empty Rules Tests: Basic 1`] = `
".test4 {
text-align: right;
}

.test5 {
padding-left: 0;
padding-right: 20px;
}"
`;
25 changes: 25 additions & 0 deletions tests/__snapshots__/empty-rules/override/basic.snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`[[Mode: override]] Empty Rules Tests: Basic 1`] = `
".test1 {}

.test2, .test3 {}

.test4 {
text-align: left;
}

[dir="rtl"] .test4 {
text-align: right;
}

.test5 {
color: red;
padding-left: 20px;
}

[dir="rtl"] .test5 {
padding-left: 0;
padding-right: 20px;
}"
`;
13 changes: 11 additions & 2 deletions tests/empty-rules.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import postcss from 'postcss';
import postcssRTLCSS from '../src';
import { PluginOptions } from '../src/@types';
import { readCSSFile, runTests } from './utils';
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: `, () => {
Expand All @@ -14,7 +21,9 @@ runTests({}, (pluginOptions: PluginOptions): void => {
it('Basic', (): void => {
const options: PluginOptions = { ...pluginOptions };
const output = postcss([postcssRTLCSS(options)]).process(input);
expect(output.css).toMatchSnapshot();
expect(output.css).toMatchSpecificSnapshot(
createSnapshotFileName(BASE_NAME,'basic', pluginOptions.mode)
);
expect(output.warnings()).toHaveLength(0);
});
});
Expand Down