Skip to content

Commit

Permalink
fix: update test snapshots (#729)
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Aug 5, 2021
1 parent de67aea commit 452d2e8
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 35 deletions.
Binary file modified test/babel6/snapshots/external.js.snap
Binary file not shown.
Binary file modified test/babel6/snapshots/index.js.snap
Binary file not shown.
Binary file modified test/babel6/snapshots/plugins.js.snap
Binary file not shown.
2 changes: 1 addition & 1 deletion test/external.js
Expand Up @@ -117,7 +117,7 @@ test('Makes sure that style nodes are not re-used', async t => {
test('Make sure that it works with the new automatic transform', async t => {
const { code } = await transformSource(
`
import { css } from "styled-jsx/css";
import css from "styled-jsx/css";
const A = css.resolve\`
div {
Expand Down
Binary file modified test/snapshots/external.js.snap
Binary file not shown.
54 changes: 20 additions & 34 deletions test/snapshots/index.js.md
Expand Up @@ -238,6 +238,26 @@ Generated by [AVA](https://ava.li).
</div>;␊
}`

## works with exported jsx-style (CommonJS modules)

> Snapshot 1
`"use strict";␊
var _style = _interopRequireDefault(require("styled-jsx/style"));␊
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }␊
module.exports = () => <p className={"jsx-3800097675"}><_style.default id={"3800097675"}>{"p.jsx-3800097675{color:red;}"}</_style.default></p>;`

## works with exported non-jsx style (CommonJS modules)

> Snapshot 1
`"use strict";␊
module.exports = () => <p><style>{`p { color:red; }`}</style></p>;`

## works with expressions in template literals

> Snapshot 1
Expand Down Expand Up @@ -321,20 +341,6 @@ Generated by [AVA](https://ava.li).
const Test2 = () => <_JSXStyle id={"2743241663"}>{"p{color:red;}"}</_JSXStyle>;`

## works with module.exports component (CommonJS modules)

> Snapshot 1
`"use strict";␊
var _style = _interopRequireDefault(require("styled-jsx/style"));␊
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }␊
module.exports = () => <p className={"jsx-2982525546"}>␊
<_style.default id={"2982525546"}>{"p.jsx-2982525546{color:red;}"}</_style.default>␊
</p>;`

## works with multiple jsx blocks

> Snapshot 1
Expand Down Expand Up @@ -391,23 +397,3 @@ Generated by [AVA](https://ava.li).
<p className={"jsx-2743241663"}>woot</p>␊
<_JSXStyle id={"2743241663"}>{"p.jsx-2743241663{color:red;}"}</_JSXStyle>␊
</div>);`

## works with exported jsx-style (CommonJS modules)

> Snapshot 1
`"use strict";␊
var _style = _interopRequireDefault(require("styled-jsx/style"));␊
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }␊
module.exports = () => <p className={"jsx-3800097675"}><_style.default id={"3800097675"}>{"p.jsx-3800097675{color:red;}"}</_style.default></p>;`

## works with exported non-jsx style (CommonJS modules)

> Snapshot 1
`"use strict";␊
module.exports = () => <p><style>{`p { color:red; }`}</style></p>;`
Binary file modified test/snapshots/index.js.snap
Binary file not shown.
Binary file modified test/snapshots/plugins.js.snap
Binary file not shown.

0 comments on commit 452d2e8

Please sign in to comment.