From 9c6817abbe3d025e5f46f07bfe49bb072250c556 Mon Sep 17 00:00:00 2001 From: Melissa Liu Date: Mon, 16 Dec 2024 10:43:01 -0800 Subject: [PATCH] Fixed babel test --- .../stylex-transform-define-vars-test.js | 10 +++++----- .../define-vars/stylex-define-vars-test.js | 16 ++++++---------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/packages/babel-plugin/__tests__/stylex-transform-define-vars-test.js b/packages/babel-plugin/__tests__/stylex-transform-define-vars-test.js index f39daba0..78c95553 100644 --- a/packages/babel-plugin/__tests__/stylex-transform-define-vars-test.js +++ b/packages/babel-plugin/__tests__/stylex-transform-define-vars-test.js @@ -301,15 +301,15 @@ describe('@stylexjs/babel-plugin', () => { }, }); `, - { debug: true, ...defaultOpts }, + { ...defaultOpts, debug: true }, ).code, ).toMatchInlineSnapshot(` "import stylex from 'stylex'; export const buttonTheme = { - bgColor: "var(--xgck17p)", - bgColorDisabled: "var(--xpegid5)", - cornerRadius: "var(--xrqfjmn)", - fgColor: "var(--x4y59db)", + bgColor: "var(--bgColor-xgck17p)", + bgColorDisabled: "var(--bgColorDisabled-xpegid5)", + cornerRadius: "var(--cornerRadius-xrqfjmn)", + fgColor: "var(--fgColor-x4y59db)", __themeName__: "x568ih9" };" `); diff --git a/packages/shared/__tests__/define-vars/stylex-define-vars-test.js b/packages/shared/__tests__/define-vars/stylex-define-vars-test.js index a23d676b..388ba920 100644 --- a/packages/shared/__tests__/define-vars/stylex-define-vars-test.js +++ b/packages/shared/__tests__/define-vars/stylex-define-vars-test.js @@ -220,18 +220,14 @@ describe('stylex-define-vars test', () => { expect(jsOutput).toEqual({ __themeName__: classNamePrefix + createHash(themeName), - bgColor: `var(--${'bgColor-' + classNamePrefix + createHash(`${themeName}.bgColor`)})`, - bgColorDisabled: `var(--${ - 'bgColorDisabled-' + - classNamePrefix + - createHash(`${themeName}.bgColorDisabled`) + bgColor: `var(--bgColor-${classNamePrefix + createHash(`${themeName}.bgColor`)})`, + bgColorDisabled: `var(--bgColorDisabled-${ + classNamePrefix + createHash(`${themeName}.bgColorDisabled`) })`, - cornerRadius: `var(--${ - 'cornerRadius-' + - classNamePrefix + - createHash(`${themeName}.cornerRadius`) + cornerRadius: `var(--cornerRadius-${ + classNamePrefix + createHash(`${themeName}.cornerRadius`) })`, - fgColor: `var(--${'fgColor-' + classNamePrefix + createHash(`${themeName}.fgColor`)})`, + fgColor: `var(--fgColor-${classNamePrefix + createHash(`${themeName}.fgColor`)})`, }); expect(cssOutput).toMatchInlineSnapshot(`