Skip to content

Commit

Permalink
Update test refs
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Mar 22, 2024
1 parent 9a2514f commit c8736f5
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 6 deletions.
12 changes: 11 additions & 1 deletion packages/styled-jsx/transform/tests/fixture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::path::PathBuf;

use anyhow::bail;
use lightningcss::stylesheet::ParserOptions;
use preset_env_base::Versions;
use styled_jsx::visitor::{styled_jsx, NativeConfig};
use swc_common::{chain, FileName, Mark, Span, DUMMY_SP};
use swc_ecma_parser::{EsConfig, Syntax};
Expand All @@ -26,14 +27,23 @@ fn run(input: PathBuf, use_lightningcss: bool) {
test_fixture(
syntax(),
&|t| {
let browsers = Versions {
chrome: Some("64".parse().unwrap()),
edge: Some("79".parse().unwrap()),
firefox: Some("67".parse().unwrap()),
opera: Some("51".parse().unwrap()),
safari: Some("12".parse().unwrap()),

..Default::default()
};
chain!(
resolver(Mark::new(), Mark::new(), false),
styled_jsx(
t.cm.clone(),
FileName::Real(PathBuf::from("/some-project/src/some-file.js")),
styled_jsx::visitor::Config {
use_lightningcss,
..Default::default()
browsers,
},
if use_lightningcss {
Default::default()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const _defaultExport = new String("@media (width<=870px){.expiration-date-cellth,.expiration-date-celltd{display:none}}");
const _defaultExport = new String("@media (max-width:870px){.expiration-date-cellth,.expiration-date-celltd{display:none}}");
_defaultExport.__hash = "fd71bf06ba8860bb";
export default _defaultExport;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import _JSXStyle from "styled-jsx/style";
export default (()=><div className={"jsx-d04039089afb0c71"}>

<p className={"jsx-d04039089afb0c71"}>test</p>

<p className={"jsx-d04039089afb0c71"}>woot</p>

<p className={"jsx-d04039089afb0c71"}>woot</p>

<_JSXStyle id={"d04039089afb0c71"}>{".container.jsx-d04039089afb0c71{color:#00f;padding:3rem}.container.jsx-d04039089afb0c71.inner.jsx-d04039089afb0c71{color:#ff0}"}</_JSXStyle>

</div>);

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ export default (()=><div className={"jsx-6881055ff9b1aeb6"}>

<p className={"jsx-6881055ff9b1aeb6"}>test</p>

<_JSXStyle id={"6881055ff9b1aeb6"}>{"html.jsx-6881055ff9b1aeb6{background-image:linear-gradient(#fffc,#fffc),url(/static/background.svg)}p{color:#001}h1{color:#002}h2,a.jsx-6881055ff9b1aeb6{color:#003}.foo+a{color:#004}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif}"}</_JSXStyle>
<_JSXStyle id={"6881055ff9b1aeb6"}>{"html.jsx-6881055ff9b1aeb6{background-image:linear-gradient(rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg)}p{color:#001}h1{color:#002}h2,a.jsx-6881055ff9b1aeb6{color:#003}.foo+a{color:#004}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif}"}</_JSXStyle>

</div>);
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ export default (()=><div className={"jsx-1f7963ae04c6466a"}>

<p className={"jsx-1f7963ae04c6466a"}>test</p>

<_JSXStyle id={"1f7963ae04c6466a"}>{"@media (width>=1px) and (width<=768px){[class*=grid__col--].jsx-1f7963ae04c6466a{margin-top:12px;margin-bottom:12px}}@media (width<=64em){.test.jsx-1f7963ae04c6466a{margin-bottom:1em}@supports ((-moz-appearance:none)) and (display:contents){.test.jsx-1f7963ae04c6466a{margin-bottom:2rem}}}"}</_JSXStyle>
<_JSXStyle id={"1f7963ae04c6466a"}>{"@media (min-width:1px) and (max-width:768px){[class*=grid__col--].jsx-1f7963ae04c6466a{margin-top:12px;margin-bottom:12px}}@media (max-width:64em){.test.jsx-1f7963ae04c6466a{margin-bottom:1em}@supports ((-moz-appearance:none)) and (display:contents){.test.jsx-1f7963ae04c6466a{margin-bottom:2rem}}}"}</_JSXStyle>

</div>);

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c8736f5

Please sign in to comment.