mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 09:24:51 +00:00
test(markdown) coverage
This commit is contained in:
parent
57c57b7243
commit
de3ce19eb9
1 changed files with 5 additions and 10 deletions
|
|
@ -76,7 +76,7 @@ test('cloudcmd: markdown: put', async (t) => {
|
|||
t.end();
|
||||
});
|
||||
|
||||
test('cloudcmd: markdown: put: error', (t) => {
|
||||
test('cloudcmd: markdown: put: error', async (t) => {
|
||||
const md = path.join(fixtureDir, 'markdown-not-exist.md');
|
||||
|
||||
const name = 'hello';
|
||||
|
|
@ -85,15 +85,10 @@ test('cloudcmd: markdown: put: error', (t) => {
|
|||
mdStream.url = 'http://hello.world';
|
||||
mdStream.method = 'PUT';
|
||||
|
||||
_markdown(name, mdStream)
|
||||
.then((result) => {
|
||||
t.fail(`should fail but: ${result}`);
|
||||
t.end();
|
||||
})
|
||||
.catch((error) => {
|
||||
t.ok(error.message.includes('ENOENT: no such file or directory'), 'should emit error');
|
||||
t.end();
|
||||
});
|
||||
const [e] = await tryToCatch(_markdown, name, mdStream);
|
||||
|
||||
t.ok(e.message.includes('ENOENT: no such file or directory'), 'should emit error');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('cloudcmd: markdown: no name', async (t) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue