From de662fb6e3eb150b7104919643a3c1ba3a4e131e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Pereira=20Mu=C3=B1oz?= Date: Thu, 11 Apr 2024 23:13:26 +0200 Subject: [PATCH] Split no-flip tests snapshots into multiple files --- tests/__snapshots__/noflip.test.ts.snap | 45 ------------------- .../noflip/combined/no-flip.snapshot | 22 +++++++++ .../noflip/diff/no-flip.snapshot | 3 ++ .../noflip/override/no-flip.snapshot | 22 +++++++++ tests/noflip.test.ts | 13 +++++- 5 files changed, 58 insertions(+), 47 deletions(-) delete mode 100644 tests/__snapshots__/noflip.test.ts.snap create mode 100644 tests/__snapshots__/noflip/combined/no-flip.snapshot create mode 100644 tests/__snapshots__/noflip/diff/no-flip.snapshot create mode 100644 tests/__snapshots__/noflip/override/no-flip.snapshot diff --git a/tests/__snapshots__/noflip.test.ts.snap b/tests/__snapshots__/noflip.test.ts.snap deleted file mode 100644 index 307ee4ae..00000000 --- a/tests/__snapshots__/noflip.test.ts.snap +++ /dev/null @@ -1,45 +0,0 @@ -// 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; -}" -`; - -exports[`[[Mode: diff]] Combined Tests: No Flip 1`] = `""`; - -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; -}" -`; diff --git a/tests/__snapshots__/noflip/combined/no-flip.snapshot b/tests/__snapshots__/noflip/combined/no-flip.snapshot new file mode 100644 index 00000000..07c3ddee --- /dev/null +++ b/tests/__snapshots__/noflip/combined/no-flip.snapshot @@ -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; +}" +`; diff --git a/tests/__snapshots__/noflip/diff/no-flip.snapshot b/tests/__snapshots__/noflip/diff/no-flip.snapshot new file mode 100644 index 00000000..f42b7912 --- /dev/null +++ b/tests/__snapshots__/noflip/diff/no-flip.snapshot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`[[Mode: diff]] Combined Tests: No Flip 1`] = `""`; diff --git a/tests/__snapshots__/noflip/override/no-flip.snapshot b/tests/__snapshots__/noflip/override/no-flip.snapshot new file mode 100644 index 00000000..efe2f7cd --- /dev/null +++ b/tests/__snapshots__/noflip/override/no-flip.snapshot @@ -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; +}" +`; diff --git a/tests/noflip.test.ts b/tests/noflip.test.ts index 95ce6033..b040a32f 100644 --- a/tests/noflip.test.ts +++ b/tests/noflip.test.ts @@ -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 => { @@ -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); });