Skip to content

Commit

Permalink
updated tests snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed May 5, 2023
1 parent 6fd64c4 commit 39253d7
Show file tree
Hide file tree
Showing 48 changed files with 10,203 additions and 5,724 deletions.
2 changes: 1 addition & 1 deletion deps/imagick.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/x/[email protected].21/mod.ts";
export * from "https://deno.land/x/[email protected].22/mod.ts";
147 changes: 94 additions & 53 deletions tests/__snapshots__/base_path.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -70,71 +70,112 @@ snapshot[`base_path plugin 2`] = `
}
`;

snapshot[`base_path plugin 3`] = `
[
]
`;
snapshot[`base_path plugin 3`] = `[]`;

snapshot[`base_path plugin 4`] = `
{
content: '<!DOCTYPE html>
<html lang="en"><head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link id="style-1" rel="stylesheet" href="/blog/style.css">
<link id="style-2" rel="stylesheet" href="other-styles.css">
<link id="style-3" rel="stylesheet" href="./other-styles.css">
<link id="preload-1" rel="preload" href="/blog/fonts/cicle_fina-webfont.woff2" as="font" type="font/woff2" crossorigin="">
<link id="preload-2" rel="preload" as="image" imagesrcset="/blog/image-400.jpg 400w, /blog/image-800.jpg 800w, /blog/image-1600.jpg 1600w" imagesizes="100vw">
</head>
<body>
<a id="link-1" href="/blog/">Home</a>
<a id="link-2" href="/blog/">Blog</a>
<img id="img-1" src="/blog/img/avatar.png">
<img id="img-2" srcset="/blog/image-400.jpg 400w, /blog/image-800.jpg 800w, /blog/image-1600.jpg 1600w" sizes="100vw" alt="">
<picture>
<source id="source-1" srcset="/blog/image.jpeg x1, /blog/image-big.jpeg">
</picture>
<script id="script-1" src="/blog/script.js"></script>
</body></html>',
content: "<!DOCTYPE html>
" +
'<html lang="en"><head>
' +
' <meta charset="UTF-8">
' +
' <meta http-equiv="X-UA-Compatible" content="IE=edge">
' +
' <meta name="viewport" content="width=device-width, initial-scale=1.0">
' +
" <title>Document</title>
" +
' <link id="style-1" rel="stylesheet" href="/blog/style.css">
' +
' <link id="style-2" rel="stylesheet" href="other-styles.css">
' +
' <link id="style-3" rel="stylesheet" href="./other-styles.css">
' +
' <link id="preload-1" rel="preload" href="/blog/fonts/cicle_fina-webfont.woff2" as="font" type="font/woff2" crossorigin="">
' +
' <link id="preload-2" rel="preload" as="image" imagesrcset="/blog/image-400.jpg 400w, /blog/image-800.jpg 800w, /blog/image-1600.jpg 1600w" imagesizes="100vw">
' +
"</head>
" +
"<body>
" +
' <a id="link-1" href="/blog/">Home</a>
' +
' <a id="link-2" href="/blog/">Blog</a>
' +
' <img id="img-1" src="/blog/img/avatar.png">
' +
' <img id="img-2" srcset="/blog/image-400.jpg 400w, /blog/image-800.jpg 800w, /blog/image-1600.jpg 1600w" sizes="100vw" alt="">
' +
" <picture>
" +
' <source id="source-1" srcset="/blog/image.jpeg x1, /blog/image-big.jpeg">
' +
" </picture>
" +
' <script id="script-1" src="/blog/script.js"></script>
' +
"
" +
"</body></html>",
data: {
children: true,
content: '<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link id="style-1" rel="stylesheet" href="/style.css">
<link id="style-2" rel="stylesheet" href="other-styles.css">
<link id="style-3" rel="stylesheet" href="./other-styles.css">
<link id="preload-1" rel="preload" href="/fonts/cicle_fina-webfont.woff2" as="font" type="font/woff2" crossorigin>
<link id="preload-2" rel="preload" as="image" imagesrcset="/image-400.jpg 400w, /image-800.jpg 800w, /image-1600.jpg 1600w" imagesizes="100vw">
</head>
<body>
<a id="link-1" href="/">Home</a>
<a id="link-2" href="/blog/">Blog</a>
<img id="img-1" src="/img/avatar.png">
<img id="img-2" srcset="/image-400.jpg 400w, /image-800.jpg 800w, /image-1600.jpg 1600w" sizes="100vw" alt="">
<picture>
<source id="source-1" srcset="/blog/image.jpeg x1, /blog/image-big.jpeg">
</picture>
<script id="script-1" src="/script.js"></script>
</body>
</html>',
content: "<!DOCTYPE html>
" +
'<html lang="en">
' +
"<head>
" +
' <meta charset="UTF-8">
' +
' <meta http-equiv="X-UA-Compatible" content="IE=edge">
' +
' <meta name="viewport" content="width=device-width, initial-scale=1.0">
' +
" <title>Document</title>
" +
' <link id="style-1" rel="stylesheet" href="/style.css">
' +
' <link id="style-2" rel="stylesheet" href="other-styles.css">
' +
' <link id="style-3" rel="stylesheet" href="./other-styles.css">
' +
' <link id="preload-1" rel="preload" href="/fonts/cicle_fina-webfont.woff2" as="font" type="font/woff2" crossorigin>
' +
' <link id="preload-2" rel="preload" as="image" imagesrcset="/image-400.jpg 400w, /image-800.jpg 800w, /image-1600.jpg 1600w" imagesizes="100vw">
' +
"</head>
" +
"<body>
" +
' <a id="link-1" href="/">Home</a>
' +
' <a id="link-2" href="/blog/">Blog</a>
' +
' <img id="img-1" src="/img/avatar.png">
' +
' <img id="img-2" srcset="/image-400.jpg 400w, /image-800.jpg 800w, /image-1600.jpg 1600w" sizes="100vw" alt="">
' +
" <picture>
" +
' <source id="source-1" srcset="/blog/image.jpeg x1, /blog/image-big.jpeg">
' +
" </picture>
" +
' <script id="script-1" src="/script.js"></script>
' +
"</body>
" +
"</html>",
date: 1970-01-01T00:00:00.000Z,
mergedKeys: {
tags: "stringArray",
},
page: undefined,
paginate: [Function: paginate],
search: Search {},
tags: [
],
tags: [],
url: "/",
},
dest: {
Expand Down
11 changes: 3 additions & 8 deletions tests/__snapshots__/build.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ snapshot[`build a simple site 2`] = `
}
`;

snapshot[`build a simple site 3`] = `
[
]
`;
snapshot[`build a simple site 3`] = `[]`;

snapshot[`build a simple site 4`] = `
{
Expand All @@ -91,8 +88,7 @@ snapshot[`build a simple site 4`] = `
page: undefined,
paginate: [Function: paginate],
search: Search {},
tags: [
],
tags: [],
title: "Second page",
url: "/page2.html",
},
Expand Down Expand Up @@ -126,8 +122,7 @@ snapshot[`build a simple site 5`] = `
page: undefined,
paginate: [Function: paginate],
search: Search {},
tags: [
],
tags: [],
title: "First page",
url: "/page1/",
},
Expand Down
131 changes: 82 additions & 49 deletions tests/__snapshots__/code_highlight.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -70,41 +70,62 @@ snapshot[`code_hightlight plugin 2`] = `
}
`;

snapshot[`code_hightlight plugin 3`] = `
[
]
`;
snapshot[`code_hightlight plugin 3`] = `[]`;

snapshot[`code_hightlight plugin 4`] = `
{
content: '<!DOCTYPE html>
<html><head></head><body><h1>Code highlight plugin testing</h1>
<pre><code class="language-html hljs language-xml"><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>This is a HTML code<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
</code></pre>
<pre><code>Not highlighted code
</code></pre>
<pre><code class="language-css hljs"><span class="hljs-selector-tag">p</span> {
<span class="hljs-attribute">color</span>: red
}
</code></pre>
</body></html>',
content: "<!DOCTYPE html>
" +
"<html><head></head><body><h1>Code highlight plugin testing</h1>
" +
'<pre><code class="language-html hljs language-xml"><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>This is a HTML code<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
' +
"</code></pre>
" +
"<pre><code>Not highlighted code
" +
"</code></pre>
" +
'<pre><code class="language-css hljs"><span class="hljs-selector-tag">p</span> {
' +
' <span class="hljs-attribute">color</span>: red
' +
"}
" +
"</code></pre>
" +
"</body></html>",
data: {
children: true,
content: "# Code highlight plugin testing
\`\`\`html
<p>This is a HTML code</p>
\`\`\`
\`\`\`
Not highlighted code
\`\`\`
\`\`\`css
p {
color: red
}
\`\`\`
" +
"
" +
"\`\`\`html
" +
"<p>This is a HTML code</p>
" +
"\`\`\`
" +
"
" +
"\`\`\`
" +
"Not highlighted code
" +
"\`\`\`
" +
"
" +
"\`\`\`css
" +
"p {
" +
" color: red
" +
"}
" +
"\`\`\`
",
date: 1970-01-01T00:00:00.000Z,
mergedKeys: {
Expand All @@ -113,8 +134,7 @@ p {
page: undefined,
paginate: [Function: paginate],
search: Search {},
tags: [
],
tags: [],
url: "/",
},
dest: {
Expand All @@ -133,33 +153,46 @@ p {

snapshot[`code_hightlight plugin 5`] = `
{
content: '<!DOCTYPE html>
<html><head></head><body>
<pre>Code inside a PRE</pre>
<code>Code inside a CODE</code>
<pre><code>Not highlighted code</code></pre>
<pre class="language-css"><code class="hljs language-css"><span class="hljs-selector-tag">p</span> { <span class="hljs-attribute">display</span>: none }</code></pre>
</body></html>',
content: "<!DOCTYPE html>
" +
"<html><head></head><body>
" +
" <pre>Code inside a PRE</pre>
" +
" <code>Code inside a CODE</code>
" +
" <pre><code>Not highlighted code</code></pre>
" +
' <pre class="language-css"><code class="hljs language-css"><span class="hljs-selector-tag">p</span> { <span class="hljs-attribute">display</span>: none }</code></pre>
' +
"
" +
"</body></html>",
data: {
children: true,
content: '<html>
<body>
<pre>Code inside a PRE</pre>
<code>Code inside a CODE</code>
<pre><code>Not highlighted code</code></pre>
<pre class="language-css"><code>p { display: none }</code></pre>
</body>
</html>',
content: "<html>
" +
"<body>
" +
" <pre>Code inside a PRE</pre>
" +
" <code>Code inside a CODE</code>
" +
" <pre><code>Not highlighted code</code></pre>
" +
' <pre class="language-css"><code>p { display: none }</code></pre>
' +
"</body>
" +
"</html>",
date: 1970-01-01T00:00:00.000Z,
mergedKeys: {
tags: "stringArray",
},
page: undefined,
paginate: [Function: paginate],
search: Search {},
tags: [
],
tags: [],
url: "/other/",
},
dest: {
Expand Down
Loading

0 comments on commit 39253d7

Please sign in to comment.