Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F3010131
markdown.test.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
787 B
Referenced Files
None
Subscribers
None
markdown.test.ts
View Options
import
{
Registry
}
from
"../registry"
;
import
{
Markdown
}
from
"./markdown"
;
import
{
JDDocument
,
render
,
simpleJDDContext
}
from
"../index"
;
import
assert
from
"assert"
;
import
{
streamToString
}
from
"tempstream"
;
describe
(
"markdown component"
,
()
=>
{
it
(
"renders as a part of a JDD"
,
async
()
=>
{
const
document
=
[
{
component_name
:
"markdown"
,
args
:
{
markdown
:
`# Hello World`
}
},
{
component_name
:
"markdown"
,
args
:
{
markdown
:
`Multiple components ftw`
},
},
]
as
JDDocument
;
const
registry
=
new
Registry
();
registry
.
add
(
"markdown"
,
Markdown
);
const
result
=
await
streamToString
(
render
(
registry
,
document
,
simpleJDDContext
)
);
assert
.
strictEqual
(
result
,
`<h1>Hello World</h1>\n\n<p>Multiple components ftw</p>\n`
);
});
});
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Wed, May 7, 19:37 (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
625767
Default Alt Text
markdown.test.ts (787 B)
Attached To
Mode
rJDD jdd
Attached
Detach File
Event Timeline
Log In to Comment