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
45 changes: 0 additions & 45 deletions tests/__snapshots__/noflip.test.ts.snap

This file was deleted.

22 changes: 22 additions & 0 deletions tests/__snapshots__/noflip/combined/no-flip.snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`[[Mode: combined]] Combined Tests: No Flip 1`] = `
".test1 {
color: #000;
font-size: 10px;
font-weight: bold;
}

.test2, .test3 {
height: 100%;
width: 100%;
}

.test4,
.test5 {
border: 1px solid #FFF;
font-family: Arial;
font-weight: bold;
text-align: center;
}"
`;
3 changes: 3 additions & 0 deletions tests/__snapshots__/noflip/diff/no-flip.snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`[[Mode: diff]] Combined Tests: No Flip 1`] = `""`;
22 changes: 22 additions & 0 deletions tests/__snapshots__/noflip/override/no-flip.snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`[[Mode: override]] Combined Tests: No Flip 1`] = `
".test1 {
color: #000;
font-size: 10px;
font-weight: bold;
}

.test2, .test3 {
height: 100%;
width: 100%;
}

.test4,
.test5 {
border: 1px solid #FFF;
font-family: Arial;
font-weight: bold;
text-align: center;
}"
`;
13 changes: 11 additions & 2 deletions tests/noflip.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, Mode } from '../src/@types';
import { readCSSFile, runTests } from './utils';
import {
readCSSFile,
runTests,
createSnapshotFileName
} from './utils';
import 'jest-specific-snapshot';

const BASE_NAME = 'noflip';

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

Expand All @@ -17,7 +24,9 @@ runTests({}, (pluginOptions: PluginOptions): void => {
const output = pluginOptions.mode === Mode.combined
? postcss([postcssRTLCSS()]).process(input)
: postcss([postcssRTLCSS(pluginOptions)]).process(input);
expect(output.css).toMatchSnapshot();
expect(output.css).toMatchSpecificSnapshot(
createSnapshotFileName(BASE_NAME,'no-flip', pluginOptions.mode)
);
expect(output.warnings()).toHaveLength(0);
});

Expand Down