Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit37e290a

Browse files
committed
test: restore 100% branch coverage
1 parentc9a8044 commit37e290a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎test/load-parser-config.test.js‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
importtestfrom"ava";
2+
importimportFromfrom"import-from-esm";
3+
importsinonfrom"sinon";
24
importloadParserConfigfrom"../lib/load-parser-config.js";
35

46
constcwd=process.cwd();
@@ -100,3 +102,12 @@ test('Throw error if "config" doesn`t exist', async (t) => {
100102
test('Throw error if "preset" doesn`t exist',async(t)=>{
101103
awaitt.throwsAsync(loadParserConfig({preset:"unknown-preset"},{ cwd}),{code:"MODULE_NOT_FOUND"});
102104
});
105+
106+
test.serial("Load preset and config correctly when importFrom.silent fails",async(t)=>{
107+
sinon.stub(importFrom,"silent").returns(undefined);
108+
109+
awaitloadPreset(t,"angular");
110+
awaitloadConfig(t,"angular");
111+
112+
sinon.restore();
113+
});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp