Skip to content

Commit

Permalink
Fixed babel test
Browse files Browse the repository at this point in the history
  • Loading branch information
mellyeliu committed Dec 16, 2024
1 parent 7f960a5 commit 9c6817a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
};"
`);
Expand Down
16 changes: 6 additions & 10 deletions packages/shared/__tests__/define-vars/stylex-define-vars-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(`
Expand Down

0 comments on commit 9c6817a

Please sign in to comment.