summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar FredKSchott <FredKSchott@users.noreply.github.com> 2021-09-03 18:07:39 +0000
committerGravatar GitHub Actions <actions@github.com> 2021-09-03 18:07:39 +0000
commite516f9c953ad1517d6115a9ecb1c355b4bffb8b9 (patch)
tree39374bffa58d22af8a14d40a97acab737e43676e
parente282e8e4ac7077a43b48bd692cfa28bbe4a9bdd0 (diff)
downloadastro-e516f9c953ad1517d6115a9ecb1c355b4bffb8b9.tar.gz
astro-e516f9c953ad1517d6115a9ecb1c355b4bffb8b9.tar.zst
astro-e516f9c953ad1517d6115a9ecb1c355b4bffb8b9.zip
[ci] yarn format
-rw-r--r--docs/src/pages/reference/builtin-components.md2
-rw-r--r--packages/astro/test/astro-component-code.test.js23
2 files changed, 14 insertions, 11 deletions
diff --git a/docs/src/pages/reference/builtin-components.md b/docs/src/pages/reference/builtin-components.md
index 7ff0e5ba6..d171c9a82 100644
--- a/docs/src/pages/reference/builtin-components.md
+++ b/docs/src/pages/reference/builtin-components.md
@@ -5,7 +5,6 @@ title: Built-In Components
Astro includes several builtin components for you to use in your projects. All builtin components are available via `import {} from 'astro/components';`.
-
## `<Code />`
```astro
@@ -24,7 +23,6 @@ This component provides syntax highlighting for code blocks at build time (no cl
You can also use the `<Prism />` component for syntax highlighting powered by the [Prism](https://prismjs.com/) syntax highlighting library. This is the library that Astro's Markdown uses by default. However, we will be transitioning all usage over to `<Code>` as we move towards our v1.0 release.
-
## `<Markdown />`
```astro
diff --git a/packages/astro/test/astro-component-code.test.js b/packages/astro/test/astro-component-code.test.js
index de291f0b5..bc5380ca1 100644
--- a/packages/astro/test/astro-component-code.test.js
+++ b/packages/astro/test/astro-component-code.test.js
@@ -36,7 +36,7 @@ Components('<Code theme="...">', async ({ runtime }) => {
assert.equal($('pre').attr('style'), 'background-color: #2e3440ff; overflow-x: auto;', 'applies custom theme');
});
-Components('<Code wrap>', async ({ runtime }) => {
+Components('<Code wrap>', async ({ runtime }) => {
{
let result = await runtime.load('/wrap-true');
assert.ok(!result.error, `build error: ${result.error}`);
@@ -66,14 +66,19 @@ Components('<Code lang="..." theme="css-variables">', async ({ runtime }) => {
const $ = doc(result.contents);
assert.equal($('pre').length, 1);
assert.equal($('pre').attr('class'), 'astro-code');
- assert.equal($('pre, pre span').map((i, f) => f.attribs ? f.attribs.style : 'no style found').toArray(), [
- "background-color: var(--astro-code-color-background); overflow-x: auto;",
- "color: var(--astro-code-token-constant)",
- "color: var(--astro-code-token-function)",
- "color: var(--astro-code-color-text)",
- "color: var(--astro-code-token-string-expression)",
- "color: var(--astro-code-color-text)",
- ]);
+ assert.equal(
+ $('pre, pre span')
+ .map((i, f) => (f.attribs ? f.attribs.style : 'no style found'))
+ .toArray(),
+ [
+ 'background-color: var(--astro-code-color-background); overflow-x: auto;',
+ 'color: var(--astro-code-token-constant)',
+ 'color: var(--astro-code-token-function)',
+ 'color: var(--astro-code-color-text)',
+ 'color: var(--astro-code-token-string-expression)',
+ 'color: var(--astro-code-color-text)',
+ ]
+ );
});
Components.run();