Skip to content

Commit ecd4753

Browse files
committed
Split no-flip tests snapshots into multiple files
1 parent d15b0f6 commit ecd4753

File tree

5 files changed

+58
-47
lines changed

5 files changed

+58
-47
lines changed

tests/__snapshots__/noflip.test.ts.snap

Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`[[Mode: combined]] Combined Tests: No Flip 1`] = `
4+
".test1 {
5+
color: #000;
6+
font-size: 10px;
7+
font-weight: bold;
8+
}
9+
10+
.test2, .test3 {
11+
height: 100%;
12+
width: 100%;
13+
}
14+
15+
.test4,
16+
.test5 {
17+
border: 1px solid #FFF;
18+
font-family: Arial;
19+
font-weight: bold;
20+
text-align: center;
21+
}"
22+
`;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`[[Mode: diff]] Combined Tests: No Flip 1`] = `""`;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`[[Mode: override]] Combined Tests: No Flip 1`] = `
4+
".test1 {
5+
color: #000;
6+
font-size: 10px;
7+
font-weight: bold;
8+
}
9+
10+
.test2, .test3 {
11+
height: 100%;
12+
width: 100%;
13+
}
14+
15+
.test4,
16+
.test5 {
17+
border: 1px solid #FFF;
18+
font-family: Arial;
19+
font-weight: bold;
20+
text-align: center;
21+
}"
22+
`;

tests/noflip.test.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
import postcss from 'postcss';
22
import postcssRTLCSS from '../src';
33
import { PluginOptions, Mode } from '../src/@types';
4-
import { readCSSFile, runTests } from './utils';
4+
import {
5+
readCSSFile,
6+
runTests,
7+
createSnapshotFileName
8+
} from './utils';
9+
import 'jest-specific-snapshot';
10+
11+
const BASE_NAME = 'noflip';
512

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

@@ -17,7 +24,9 @@ runTests({}, (pluginOptions: PluginOptions): void => {
1724
const output = pluginOptions.mode === Mode.combined
1825
? postcss([postcssRTLCSS()]).process(input)
1926
: postcss([postcssRTLCSS(pluginOptions)]).process(input);
20-
expect(output.css).toMatchSnapshot();
27+
expect(output.css).toMatchSpecificSnapshot(
28+
createSnapshotFileName(BASE_NAME,'no-flip', pluginOptions.mode)
29+
);
2130
expect(output.warnings()).toHaveLength(0);
2231
});
2332

0 commit comments

Comments
 (0)