test: add test for full coverage testing

This commit is contained in:
Michel Jonathan Schmitz
2019-06-19 16:14:51 +02:00
parent 45755000f3
commit 6fb58f3790

View File

@@ -120,8 +120,22 @@ export class E2EConnectorSpec {
const emptyDirPath = join(__dirname, 'emptyDir');
if(!existsSync(emptyDirPath))
mkdirSync(emptyDirPath);
return indexSamples(httpClient, {to: 'http://localhost', samples: emptyDirPath})
await indexSamples(httpClient, {to: 'http://localhost', samples: emptyDirPath})
.should.be.rejectedWith('Could not index samples. None were retrived from the file system.');
rmdirSync(emptyDirPath);
}
@test
async indexShouldFailDirectoryWithoutJsonData() {
const somewhatFilledDirPath = join(__dirname, 'somewhatFilledDir');
if(!existsSync(somewhatFilledDirPath))
mkdirSync(somewhatFilledDirPath);
const nonJsonFile = join (somewhatFilledDirPath, 'nonjson.txt');
createFileSync(nonJsonFile);
await indexSamples(httpClient, {to: 'http://localhost', samples: somewhatFilledDirPath})
.should.be.rejectedWith('Could not index samples. None were retrived from the file system.');
unlinkSync(nonJsonFile);
rmdirSync(somewhatFilledDirPath);
}
}