mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-08 14:32:50 +00:00
test: create the empty test directory via code
This commit is contained in:
@@ -24,7 +24,9 @@ import {
|
||||
import * as chai from 'chai';
|
||||
import * as chaiAsPromised from 'chai-as-promised';
|
||||
import * as chaiSpies from 'chai-spies';
|
||||
import {existsSync, mkdirSync} from 'fs';
|
||||
import {suite, test} from 'mocha-typescript';
|
||||
import {join} from 'path';
|
||||
import {getItemsFromSamples, indexSamples} from '../src/e2e';
|
||||
import {ApiError} from '../src/errors';
|
||||
import {HttpClient, RequestOptions, Response} from '../src/httpClient';
|
||||
@@ -114,7 +116,10 @@ export class E2EConnectorSpec {
|
||||
|
||||
@test
|
||||
async indexShouldFailDirectoryWithoutData() {
|
||||
return indexSamples(httpClient, {to: 'http://localhost', samples: './test/emptyDir/'})
|
||||
const emptyDirPath = join(__dirname, 'emptyDir');
|
||||
if(!existsSync(emptyDirPath))
|
||||
mkdirSync(emptyDirPath);
|
||||
return indexSamples(httpClient, {to: 'http://localhost', samples: emptyDirPath})
|
||||
.should.be.rejectedWith('Could not index samples. None were retrived from the file system.');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user