Skip to content

Commit 3381e63

Browse files
authored
update snapshots (#6366)
* update snapshots * enable unit test * fix tests * update snapshots
1 parent c711493 commit 3381e63

File tree

9 files changed

+43
-20
lines changed

9 files changed

+43
-20
lines changed

.github/workflows/testing.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@ on:
44
pull_request:
55

66
jobs:
7+
unitTest:
8+
name: Unit Test
9+
strategy:
10+
matrix:
11+
os: [ubuntu-latest]
12+
node-version: [16.x]
13+
runs-on: ${{ matrix.os }}
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
cache: yarn
22+
23+
- run: yarn --frozen-lockfile
24+
- run: yarn jest
25+
726
lint:
827
name: Lint
928
strategy:

src/remark-plugins/remark-cleanup-readme/__snapshots__/index.test.mjs.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ exports[`cleanup readme should clean up div[align="center"] block with paragraph
44
"/* @jsxRuntime classic */
55
/* @jsx mdx */
66
/* @jsxFrag mdx.Fragment */
7-
const MDXLayout = \\"wrapper\\";
7+
const MDXLayout = "wrapper";
88
function MDXContent({components, ...props}) {
9-
return <MDXLayout components={components} {...props}><div align=\\"center\\"><p parentName=\\"div\\"><h1 parentName=\\"p\\">{\\"Imagemin Webpack\\"}</h1></p><p parentName=\\"div\\"><p parentName=\\"p\\">{\\"Plugin and Loader for \\"}<a href=\\"http://webpack.js.org/\\" parentName=\\"p\\">{\\"webpack\\"}</a>{\\" to optimize (compress) all images using \\"}<a href=\\"https://github.com/imagemin/imagemin\\" parentName=\\"p\\">{\\"imagemin\\"}</a>{\\".\\\\nDo not worry about size of images, now they are always optimized/compressed.\\"}</p></p></div></MDXLayout>;
9+
return <MDXLayout components={components} {...props}><div align="center"><p parentName="div"><h1 parentName="p">{"Imagemin Webpack"}</h1></p><p parentName="div"><p parentName="p">{"Plugin and Loader for "}<a href="http://webpack.js.org/" parentName="p">{"webpack"}</a>{" to optimize (compress) all images using "}<a href="https://github.com/imagemin/imagemin" parentName="p">{"imagemin"}</a>{".\\nDo not worry about size of images, now they are always optimized/compressed."}</p></p></div></MDXLayout>;
1010
}
1111
MDXContent.isMDXComponent = true;
1212
export default MDXContent;
@@ -17,9 +17,9 @@ exports[`cleanup readme should clean up div[align="center"] block without paragr
1717
"/* @jsxRuntime classic */
1818
/* @jsx mdx */
1919
/* @jsxFrag mdx.Fragment */
20-
const MDXLayout = \\"wrapper\\";
20+
const MDXLayout = "wrapper";
2121
function MDXContent({components, ...props}) {
22-
return <MDXLayout components={components} {...props}><div align=\\"center\\" /></MDXLayout>;
22+
return <MDXLayout components={components} {...props}><div align="center" /></MDXLayout>;
2323
}
2424
MDXContent.isMDXComponent = true;
2525
export default MDXContent;
@@ -30,9 +30,9 @@ exports[`cleanup readme should clean up nested div[align="center"] block 1`] =
3030
"/* @jsxRuntime classic */
3131
/* @jsx mdx */
3232
/* @jsxFrag mdx.Fragment */
33-
const MDXLayout = \\"wrapper\\";
33+
const MDXLayout = "wrapper";
3434
function MDXContent({components, ...props}) {
35-
return <MDXLayout components={components} {...props}><div align=\\"center\\" /></MDXLayout>;
35+
return <MDXLayout components={components} {...props}><div align="center" /></MDXLayout>;
3636
}
3737
MDXContent.isMDXComponent = true;
3838
export default MDXContent;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`customize blockquote should transform W> into aside of warning 1`] = `
4-
"<aside class=\\"warning\\"><h6 class=\\"warning__prefix\\">warning</h6><p>hello world</p></aside>
4+
"<aside class="warning"><h6 class="warning__prefix">warning</h6><p>hello world</p></aside>
55
"
66
`;

src/remark-plugins/remark-custom-asides/index.test.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ describe('customize blockquote', () => {
99
'W>': 'warning',
1010
},
1111
})
12-
.use(remarkHtml)
12+
.use(remarkHtml, {
13+
sanitize: false
14+
})
1315
.process(
1416
`
1517
W> hello world
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`customize blockquote should add id 1`] = `
4-
"<h2><span id=\\"user-content-hello-world\\"></span>hello world</h2>
4+
"<h2><span id="user-content-hello-world"></span>hello world</h2>
55
<p>this is me.</p>
66
"
77
`;

src/remark-plugins/remark-responsive-table/__snapshots__/remark-responsive-table.test.mjs.snap

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ exports[`responsive table should add data-th 1`] = `
1010
</thead>
1111
<tbody>
1212
<tr>
13-
<td data-th=\\"foo\\"><span>baz</span></td>
14-
<td data-th=\\"bar\\"><span>-</span></td>
13+
<td data-th="foo"><span>baz</span></td>
14+
<td data-th="bar"><span>-</span></td>
1515
</tr>
1616
<tr>
17-
<td data-th=\\"foo\\"><span>sam</span></td>
18-
<td data-th=\\"bar\\"><span>chen</span></td>
17+
<td data-th="foo"><span>sam</span></td>
18+
<td data-th="bar"><span>chen</span></td>
1919
</tr>
2020
</tbody>
2121
</table>
@@ -32,12 +32,12 @@ exports[`responsive table should handle empty thead 1`] = `
3232
</thead>
3333
<tbody>
3434
<tr>
35-
<td data-th=\\"\\"><span>baz</span></td>
36-
<td data-th=\\"bar\\"><span>-</span></td>
35+
<td data-th=""><span>baz</span></td>
36+
<td data-th="bar"><span>-</span></td>
3737
</tr>
3838
<tr>
39-
<td data-th=\\"\\"><span>sam</span></td>
40-
<td data-th=\\"bar\\"><span>chen</span></td>
39+
<td data-th=""><span>sam</span></td>
40+
<td data-th="bar"><span>chen</span></td>
4141
</tr>
4242
</tbody>
4343
</table>

src/remark-plugins/remark-responsive-table/remark-responsive-table.test.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ describe('responsive table', () => {
88
const processor = remark()
99
.use(remarkGfm)
1010
.use(remarkResponsiveTable)
11-
.use(remarkHtml);
11+
.use(remarkHtml, {
12+
sanitize: false,
13+
});
1214
it('should add data-th', () => {
1315
processor.process(
1416
`
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`remark slug should add id 1`] = `
4-
"<h2 id=\\"user-content-hello-world\\"><span id=\\"user-content-hello-world\\"></span>hello world</h2>
4+
"<h2 id="user-content-hello-world"><span id="user-content-hello-world"></span>hello world</h2>
55
<p>this is me.</p>
66
"
77
`;

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11846,7 +11846,7 @@ unist-util-visit-parents@^4.0.0:
1184611846
"@types/unist" "^2.0.0"
1184711847
unist-util-is "^5.0.0"
1184811848

11849-
unist-util-visit-parents@^5.1.1:
11849+
unist-util-visit-parents@^5.0.0, unist-util-visit-parents@^5.1.1:
1185011850
version "5.1.1"
1185111851
resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-5.1.1.tgz#868f353e6fce6bf8fa875b251b0f4fec3be709bb"
1185211852
integrity sha512-gks4baapT/kNRaWxuGkl5BIhoanZo7sC/cUT/JToSRNL1dYoXRFl75d++NkjYk4TAu2uv2Px+l8guMajogeuiw==

0 commit comments

Comments
 (0)