Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
TorstenDittmann committed Jul 22, 2023
1 parent 7c79142 commit ce7d992
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/process/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"tabWidth": 4,
"singleQuote": true,
"trailingComma": "all"
}
}
2 changes: 1 addition & 1 deletion packages/process/src/transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function transformer({ content, tags, layout }) {
if (layout) {
dependencies += `import INTERNAL__LAYOUT from '${layout}';`;
dependencies += `import {${[...components].join(
', '
', ',
)}} from '${layout}';`;
}

Expand Down
32 changes: 19 additions & 13 deletions packages/process/src/transformer.test.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
import test from 'ava';
import { transformer } from './transformer.js';

test('can parse markdoc', t => {
t.is(transformer({
content: '# Hello World',
tags: {},
layout: null,
}), '<article><h1>Hello World</h1></article>');
test('can parse markdoc', (t) => {
t.is(
transformer({
content: '# Hello World',
tags: {},
layout: null,
}),
'<article><h1>Hello World</h1></article>',
);
});

test('can add layout', t => {
t.is(transformer({
content: 'Lorem Ipsum',
tags: {},
layout: './some/layout.svelte',
}), '<script>import INTERNAL__LAYOUT from \'./some/layout.svelte\';import {} from \'./some/layout.svelte\';</script><INTERNAL__LAYOUT><article><p>Lorem Ipsum</p></article></INTERNAL__LAYOUT>');
});
test('can add layout', (t) => {
t.is(
transformer({
content: 'Lorem Ipsum',
tags: {},
layout: './some/layout.svelte',
}),
"<script>import INTERNAL__LAYOUT from './some/layout.svelte';import {} from './some/layout.svelte';</script><INTERNAL__LAYOUT><article><p>Lorem Ipsum</p></article></INTERNAL__LAYOUT>",
);
});

0 comments on commit ce7d992

Please sign in to comment.