Skip to content

Commit

Permalink
Fix deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeTschudi committed Feb 14, 2022
1 parent f7e4d95 commit 9575641
Show file tree
Hide file tree
Showing 10 changed files with 252 additions and 97 deletions.
3 changes: 2 additions & 1 deletion jasmine.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"spec_files": ["*/test/**/*.test.ts"],
"helpers": ["../support/test-helpers.js"],
"stopSpecOnExpectationFailure": false,
"random": false
"random": true,
"verboseDeprecations": true
}
49 changes: 40 additions & 9 deletions packages/common/test/restHelpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1955,9 +1955,14 @@ describe("Module `restHelpers`: common REST utility functions shared across pack

restHelpers
.convertExtent(extent, serviceSR, geometryServiceUrl, MOCK_USER_SESSION)
.then(_extent => {
done.fail();
}, done);
.then(
() => {
done.fail();
},
() => {
done();
}
);
});

it("can handle unmatched wkid and failure on findTransformations", done => {
Expand All @@ -1976,9 +1981,14 @@ describe("Module `restHelpers`: common REST utility functions shared across pack

restHelpers
.convertExtent(extent, serviceSR, geometryServiceUrl, MOCK_USER_SESSION)
.then(_extent => {
done.fail();
}, done);
.then(
() => {
done.fail();
},
() => {
done();
}
);
});
});

Expand Down Expand Up @@ -2142,7 +2152,14 @@ describe("Module `restHelpers`: common REST utility functions shared across pack
geometryServiceUrl,
MOCK_USER_SESSION
)
.then(done.fail, done);
.then(
() => {
done.fail();
},
() => {
done();
}
);
});
});

Expand Down Expand Up @@ -3595,7 +3612,14 @@ describe("Module `restHelpers`: common REST utility functions shared across pack

restHelpers
.updateGroup(grp, MOCK_USER_SESSION)
.then(() => done.fail, done);
.then(
() => {
done.fail();
},
() => {
done();
}
);
});
});

Expand Down Expand Up @@ -4731,7 +4755,14 @@ describe("Module `restHelpers`: common REST utility functions shared across pack
);
restHelpers
._getCreateServiceOptions(itemTemplate, userSession, templateDictionary)
.then(done.fail, done);
.then(
() => {
done.fail();
},
() => {
done();
}
);
});
});

Expand Down
18 changes: 16 additions & 2 deletions packages/common/test/workforceHelpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,14 @@ describe("Module `workforceHelpers`: manages the creation and deployment of work
it("will handle no edits", done => {
workforceHelpers
._applyEdits("http://url", [], MOCK_USER_SESSION)
.then(done, done.fail);
.then(
() => {
done();
},
() => {
done.fail();
}
);
});
});
describe("_extractDependencies", () => {
Expand Down Expand Up @@ -361,7 +368,14 @@ describe("Module `workforceHelpers`: manages the creation and deployment of work

workforceHelpers
.getWorkforceServiceInfo(props, url, MOCK_USER_SESSION)
.then(() => done.fail, done);
.then(
() => {
done.fail();
},
() => {
done();
}
);
});

it("can handle _getAssignmentIntegrationInfos failure", done => {
Expand Down
45 changes: 40 additions & 5 deletions packages/deployer/test/deploySolutionItems.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,14 @@ describe("Module `deploySolutionItems`", () => {
progressCallback: utils.SOLUTION_PROGRESS_CALLBACK
}
)
.then(() => done.fail(), done);
.then(
() => {
done.fail();
},
() => {
done();
}
);
});

it("can handle error on find items by tag", done => {
Expand Down Expand Up @@ -857,7 +864,14 @@ describe("Module `deploySolutionItems`", () => {
progressCallback: utils.SOLUTION_PROGRESS_CALLBACK
}
)
.then(() => done.fail(), done);
.then(
() => {
done.fail();
},
() => {
done();
}
);
});

it("handles failure to delete all items when unwinding after failure to deploy", done => {
Expand Down Expand Up @@ -1152,7 +1166,14 @@ describe("Module `deploySolutionItems`", () => {
progressCallback: utils.SOLUTION_PROGRESS_CALLBACK
}
)
.then(() => done.fail(), done);
.then(
() => {
done.fail();
},
() => {
done();
}
);
});

it("handle failure to use existing items", done => {
Expand Down Expand Up @@ -1231,7 +1252,14 @@ describe("Module `deploySolutionItems`", () => {
progressCallback: utils.SOLUTION_PROGRESS_CALLBACK
}
)
.then(() => done.fail(), done);
.then(
() => {
done.fail();
},
() => {
done();
}
);
});
});

Expand Down Expand Up @@ -2616,7 +2644,14 @@ describe("Module `deploySolutionItems`", () => {
it("will handle no custom item id requests", done => {
deploySolution
._setTypekeywordForExisting([], {}, MOCK_USER_SESSION)
.then(done);
.then(
() => {
done();
},
() => {
done.fail();
}
);
});
});
});
22 changes: 16 additions & 6 deletions packages/deployer/test/deployer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -704,9 +704,14 @@ describe("Module `deployer`", () => {
};
deployer
.deploySolution(itemInfo.item.id, MOCK_USER_SESSION, options)
.then(done, e => {
done.fail(e);
});
.then(
() => {
done();
},
e => {
done.fail(e);
}
);
},
e => {
done.fail(e);
Expand Down Expand Up @@ -1028,9 +1033,14 @@ describe("Module `deployer`", () => {

deployer
.deploySolution(itemInfoCard.id, MOCK_USER_SESSION, options)
.then(() => {
done.fail();
}, done);
.then(
() => {
done.fail();
},
() => {
done();
}
);
});

it("can handle error on createItemWithData", done => {
Expand Down
40 changes: 32 additions & 8 deletions packages/feature-layer/test/feature-layer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,14 @@ describe("Module `feature-layer`: manages the creation and deployment of feature
MOCK_USER_SESSION,
templateDictionary
)
.then(r => {
done.fail();
}, done);
.then(
() => {
done.fail();
},
() => {
done();
}
);
});

it("should handle error on getItemData", done => {
Expand Down Expand Up @@ -384,7 +389,14 @@ describe("Module `feature-layer`: manages the creation and deployment of feature
MOCK_USER_SESSION,
templateDictionary
)
.then(done, done.fail);
.then(
() => {
done();
},
e => {
done.fail(e);
}
);
});

it("should handle error on getServiceLayersAndTables", done => {
Expand Down Expand Up @@ -426,9 +438,14 @@ describe("Module `feature-layer`: manages the creation and deployment of feature
MOCK_USER_SESSION,
templateDictionary
)
.then(r => {
done.fail();
}, done);
.then(
() => {
done.fail();
},
() => {
done();
}
);
});
});

Expand Down Expand Up @@ -2749,7 +2766,14 @@ describe("Module `feature-layer`: manages the creation and deployment of feature

featureLayer
.postProcess("", "", [], template, [], {}, MOCK_USER_SESSION)
.then(done, done.fail);
.then(
() => {
done();
},
e => {
done.fail(e);
}
);
});
});
});
39 changes: 21 additions & 18 deletions packages/simple-types/test/oic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,33 +92,36 @@ describe("Module `webmap`: manages the creation and deployment of OIC (Oriented
});

describe("_extractDependencies", () => {
it("handles missing data or properties", done => {
it("handles missing data or properties", () => {
const expectedDependencies = {
dependencies: [] as string[],
urlHash: {} as any
};
let itemTemplate: common.IItemTemplate;

oic
._extractDependencies(templates.getItemTemplateSkeleton(), null)
.then(actual => {
expect(actual).toEqual(expectedDependencies);
done();
}, done.fail);
return oic._extractDependencies(templates.getItemTemplateSkeleton(), null)
.then(actual => {
expect(actual).toEqual(expectedDependencies);

const itemTemplate = templates.getItemTemplate(
"Oriented Imagery Catalog"
);
itemTemplate.data.properties = null;
oic._extractDependencies(itemTemplate, null).then(actual => {
itemTemplate = templates.getItemTemplate(
"Oriented Imagery Catalog"
);
itemTemplate.data.properties = null;
return oic._extractDependencies(itemTemplate, null);
})
.then(actual => {
expect(actual).toEqual(expectedDependencies);
done();
}, done.fail);

itemTemplate.data = null;
oic._extractDependencies(itemTemplate, null).then(actual => {
itemTemplate.data = null;
return oic._extractDependencies(itemTemplate, null);
})
.then(actual => {
expect(actual).toEqual(expectedDependencies);
done();
}, done.fail);
return Promise.resolve();
})
.catch(error => {
return Promise.reject(error);
});
});

it("handles both of the URL properties", done => {
Expand Down
11 changes: 8 additions & 3 deletions packages/simple-types/test/webmappingapplication.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1143,9 +1143,14 @@ describe("Module `webmappingapplication`: manages the creation and deployment of

webmappingapplication
.convertItemToTemplate(infoLookupTemplate, MOCK_USER_SESSION, MOCK_USER_SESSION)
.then(template => {
done.fail();
}, done);
.then(
() => {
done.fail();
},
() => {
done();
}
);
});
});

Expand Down
Loading

0 comments on commit 9575641

Please sign in to comment.