Skip to content

Commit

Permalink
Test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Jan 6, 2020
1 parent ca89abb commit 0792608
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 44 deletions.
4 changes: 2 additions & 2 deletions packages/gatsby-remark-shiki/test/fixtures/twoliner.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
// @filename: getStringLength.ts
export const getStringLength = (str: string) => str.length
// @filename: index.ts
import {getStringLength} from "./getStringLength"
const b = getStringLength("string)
import { getStringLength } from './getStringLength'
const b = getStringLength('string')
```
4 changes: 2 additions & 2 deletions packages/gatsby-remark-shiki/test/results/one.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ <h2>One liner with multiple IDs</h2>
padding: 8px;
}
.lsp-result::before {
content: ' <';
content: " <";
}
.lsp-result::after {
content: '> ';
content: "> ";
}
.lsp-result {
text-decoration: none !important;
Expand Down
20 changes: 11 additions & 9 deletions packages/gatsby-remark-shiki/test/results/twoliner.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
<h2>Two liner with multiple IDs</h2>
<pre
class="shiki twoslash"
><div class="language-id">ts</div><div class='code-container'><code><span style="color: #4C566A">// @filename: getStringLength.ts</span>
<span style="color: #81A1C1">export</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">const</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">getStringLength</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9">str</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">string</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">str</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">length</span>
<span style="color: #4C566A">// @filename: index.ts</span>
<span style="color: #81A1C1">import</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">getStringLength</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">from</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">'</span><span style="color: #A3BE8C">./getStringLength</span><span style="color: #ECEFF4">'</span>
<span style="color: #81A1C1">const</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">b</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">getStringLength</span><span style="color: #D8DEE9FF">(</span><span style="color: #ECEFF4">'</span><span style="color: #A3BE8C">string</span><span style="color: #ECEFF4">'</span><span style="color: #D8DEE9FF">)</span></code></div></pre>

<style>
.shiki {
background-color: rgb(20, 30, 60);
padding: 8px;
}
.lsp-result::before {
content: ' <';
content: " <";
}
.lsp-result::after {
content: '> ';
content: "> ";
}
.lsp-result {
text-decoration: none !important;
Expand Down Expand Up @@ -42,10 +51,3 @@
color: #ffeeee;
}
</style>
<h2>Two liner with multiple IDs</h2>
<pre
class="shiki twoslash"
><div class="language-id">ts</div><div class='code-container'><code><span style="color: #81A1C1">const</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0"><span class='lsp'>getStringLength<span class='lsp-result'>const getStringLength: (str: string) =&gt; number</span></span></span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9"><span class='lsp'>str<span class='lsp-result'>(parameter) str: string</span></span></span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">string</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9"><span class='lsp'>str<span class='lsp-result'>(parameter) str: string</span></span></span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9"><span class='lsp'>length<span class='lsp-result'>(property) String.length: number</span></span></span>
<span style="color: #81A1C1">const</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9"><span class='lsp'>exports<span class='lsp-result'>const exports: {&#13; getStringLength: (str: string) =&gt; number;&#13;}</span></span></span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span>
<span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9"><span class='lsp'>getStringLength<span class='lsp-result'>(property) getStringLength: (str: string) =&gt; number</span></span></span><span style="color: #ECEFF4">,</span>
<span style="color: #ECEFF4">}</span></code></div></pre>
71 changes: 40 additions & 31 deletions packages/gatsby-remark-shiki/test/results/twoliner.json
Original file line number Diff line number Diff line change
@@ -1,66 +1,75 @@
[
{
"code": "const getStringLength = (str: string) => str.length\nconst exports = {\n getStringLength,\n}",
"code": "// @filename: getStringLength.ts\nexport const getStringLength = (str: string) => str.length\n// @filename: index.ts\nimport { getStringLength } from './getStringLength'\nconst b = getStringLength('string')",
"extension": "ts",
"highlights": [],
"queries": [],
"staticQuickInfos": [
{
"text": "(alias) const getStringLength: (str: string) => number\nimport getStringLength",
"docs": "",
"start": 124,
"length": 15,
"line": 1,
"character": 72,
"targetString": "getStringLength"
},
{
"text": "const b: number",
"docs": "",
"start": 173,
"length": 1,
"line": 1,
"character": 121,
"targetString": "b"
},
{
"text": "(alias) getStringLength(str: string): number\nimport getStringLength",
"docs": "",
"start": 177,
"length": 15,
"line": 1,
"character": 125,
"targetString": "getStringLength"
},
{
"text": "const getStringLength: (str: string) => number",
"docs": "",
"start": 6,
"start": 46,
"length": 15,
"line": 0,
"character": 6,
"character": 46,
"targetString": "getStringLength"
},
{
"text": "(parameter) str: string",
"docs": "",
"start": 25,
"start": 65,
"length": 3,
"line": 0,
"character": 25,
"line": 1,
"character": 6,
"targetString": "str"
},
{
"text": "(parameter) str: string",
"docs": "",
"start": 41,
"start": 81,
"length": 3,
"line": 0,
"character": 41,
"line": 1,
"character": 22,
"targetString": "str"
},
{
"text": "(property) String.length: number",
"docs": "Returns the length of a String object.",
"start": 45,
"start": 85,
"length": 6,
"line": 0,
"character": 45,
"targetString": "length"
},
{
"text": "const exports: {\n getStringLength: (str: string) => number;\n}",
"docs": "",
"start": 58,
"length": 7,
"line": 1,
"character": 6,
"targetString": "exports"
},
{
"text": "(property) getStringLength: (str: string) => number",
"docs": "",
"start": 72,
"length": 15,
"line": 2,
"character": 2,
"targetString": "getStringLength"
"character": 26,
"targetString": "length"
}
],
"errors": [],
"playgroundURL": "https://www.typescriptlang.org/play/#code/MYewdgzgLgBA5gUygZSgJwJZjgGQdqACxgF4YAKaNALhiqzgEpSA+O9AOgBt84iAoUJFgIAHgAcQaKBFIwA3vxjwkqTNjwFCAGn4BfIA"
"playgroundURL": "https://www.typescriptlang.org/play/#code/PTAEAEDMEsBsFMB2BDAtvAXKA5vALgMp4BO0i2AMktngBYB0eAzgFDwAeADgPbF6gBjboib9chEmUrU6oALygAFKOJYVUgJTyAfKBX0E5OixAQYhtJlBkAJh0atoqHn1ABvHPiKlyVI7VAAX1BIYm5UUAByemBxbyk-GlpIliERfgAjeU8JH2l-RUj1ckiNIA"
}
]

0 comments on commit 0792608

Please sign in to comment.