|
1 | 1 | importtestfrom"ava"; |
| 2 | +importimportFromfrom"import-from-esm"; |
| 3 | +importsinonfrom"sinon"; |
2 | 4 | importloadParserConfigfrom"../lib/load-parser-config.js"; |
3 | 5 |
|
4 | 6 | constcwd=process.cwd(); |
@@ -100,3 +102,12 @@ test('Throw error if "config" doesn`t exist', async (t) => { |
100 | 102 | test('Throw error if "preset" doesn`t exist',async(t)=>{ |
101 | 103 | awaitt.throwsAsync(loadParserConfig({preset:"unknown-preset"},{ cwd}),{code:"MODULE_NOT_FOUND"}); |
102 | 104 | }); |
| 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 | +}); |