fixed failing test while fetching getDags
Signed-off-by: Daniele.Mazzotta <daniele.mazzotta@tii.ae>
This commit is contained in:
@@ -107,6 +107,15 @@ describe('ApacheAirflowClient', () => {
|
||||
);
|
||||
}),
|
||||
|
||||
rest.get(`${mockBaseUrl}/airflow/dags/:dag_id`, (req, res, ctx) => {
|
||||
const { dag_id } = req.params;
|
||||
const dag = dags.find(d => d.dag_id === dag_id);
|
||||
if (dag) {
|
||||
return res(ctx.json(dag));
|
||||
}
|
||||
return res(ctx.status(404));
|
||||
}),
|
||||
|
||||
rest.patch(`${mockBaseUrl}/airflow/dags/:dag_id`, (req, res, ctx) => {
|
||||
const { dag_id } = req.params;
|
||||
const body = JSON.parse(req.body as string);
|
||||
|
||||
@@ -82,7 +82,7 @@ export class ApacheAirflowClient implements ApacheAirflowApi {
|
||||
const response = await Promise.all(
|
||||
dagIds.map(id => {
|
||||
return this.fetch<Dag>(`/dags/${id}`).catch(e => {
|
||||
if (e.message === 'NOT FOUND') {
|
||||
if (e.message === 'Not Found') {
|
||||
dagsNotFound.push(id);
|
||||
} else {
|
||||
throw e;
|
||||
|
||||
Reference in New Issue
Block a user