mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-07 22:12:53 +00:00
test: add test for full coverage testing
This commit is contained in:
@@ -120,8 +120,22 @@ export class E2EConnectorSpec {
|
|||||||
const emptyDirPath = join(__dirname, 'emptyDir');
|
const emptyDirPath = join(__dirname, 'emptyDir');
|
||||||
if(!existsSync(emptyDirPath))
|
if(!existsSync(emptyDirPath))
|
||||||
mkdirSync(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.');
|
.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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user