Skip to content

Commit

Permalink
fixing tests for nodejs v23
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandrRogov committed Feb 17, 2025
1 parent eef8d39 commit 055e0d3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/requests/upsert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export const upsert = async <TData = any>(request: UpsertRequest<TData>, client:
} catch (error: any) {
if (ifnonematch && error.status === 412) {
//if prevent update
return <any>null; //todo: check this
return null as any; //todo: check this
} else if (ifmatch && error.status === 404) {
//if prevent create
return <any>null; //todo: check this
return null as any; //todo: check this
}
//rethrow error otherwise
throw error;
Expand Down
2 changes: 1 addition & 1 deletion tests/common.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe("Regex.", () => {
it("uuid === false", function () {
const result = Regex.isUuid("something");
expect(result).to.be.false;
const result2 = Regex.isUuid(<any>null);
const result2 = Regex.isUuid(null as any);
expect(result2).to.be.false;
});
});
Expand Down
18 changes: 9 additions & 9 deletions tests/searchApi.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe("dynamicsWebApi.search -", () => {
before(() => {
const response = mocks.responses.searchMultiple;
scope = nock(mocks.searchApiUrl)
.post(mocks.responses.searchUrl, <any>searchQuery)
.post(mocks.responses.searchUrl, searchQuery as any)
.reply(response.status, response.responseText, response.responseHeaders);
});

Expand Down Expand Up @@ -56,7 +56,7 @@ describe("dynamicsWebApi.search -", () => {
before(() => {
const response = mocks.responses.searchMultiple;
scope = nock(mocks.searchApiUrl)
.post(mocks.responses.searchUrl, <any>searchQuery)
.post(mocks.responses.searchUrl, searchQuery as any)
.reply(response.status, response.responseText, response.responseHeaders);
});

Expand Down Expand Up @@ -91,7 +91,7 @@ describe("dynamicsWebApi.search -", () => {
CallerObjectId: mocks.data.testEntityId3,
},
})
.post(mocks.responses.searchUrl, <any>searchQuery)
.post(mocks.responses.searchUrl, searchQuery as any)
.reply(response.status, response.responseText, response.responseHeaders);
});

Expand Down Expand Up @@ -128,7 +128,7 @@ describe("dynamicsWebApi.suggest -", () => {
before(() => {
const response = mocks.responses.suggestMultiple;
scope = nock(mocks.searchApiUrl)
.post(mocks.responses.suggestUrl, <any>suggestQuery)
.post(mocks.responses.suggestUrl, suggestQuery as any)
.reply(response.status, response.responseText, response.responseHeaders);
});

Expand Down Expand Up @@ -161,7 +161,7 @@ describe("dynamicsWebApi.suggest -", () => {
before(() => {
const response = mocks.responses.suggestMultiple;
scope = nock(mocks.searchApiUrl)
.post(mocks.responses.suggestUrl, <any>suggestQuery)
.post(mocks.responses.suggestUrl, suggestQuery as any)
.reply(response.status, response.responseText, response.responseHeaders);
});

Expand Down Expand Up @@ -196,7 +196,7 @@ describe("dynamicsWebApi.suggest -", () => {
CallerObjectId: mocks.data.testEntityId3,
},
})
.post(mocks.responses.suggestUrl, <any>suggestQuery)
.post(mocks.responses.suggestUrl, suggestQuery as any)
.reply(response.status, response.responseText, response.responseHeaders);
});

Expand Down Expand Up @@ -233,7 +233,7 @@ describe("dynamicsWebApi.autocomplete -", () => {
before(() => {
const response = mocks.responses.autocompleteResult;
scope = nock(mocks.searchApiUrl)
.post(mocks.responses.autocompleteUrl, <any>autocompleteQuery)
.post(mocks.responses.autocompleteUrl, autocompleteQuery as any)
.reply(response.status, response.responseText, response.responseHeaders);
});

Expand Down Expand Up @@ -270,7 +270,7 @@ describe("dynamicsWebApi.autocomplete -", () => {
CallerObjectId: mocks.data.testEntityId3,
},
})
.post(mocks.responses.autocompleteUrl, <any>autocompleteQuery)
.post(mocks.responses.autocompleteUrl, autocompleteQuery as any)
.reply(response.status, response.responseText, response.responseHeaders);
});

Expand Down Expand Up @@ -304,7 +304,7 @@ describe("dynamicsWebApi.autocomplete -", () => {
before(() => {
const response = mocks.responses.autocompleteResult;
scope = nock(mocks.searchApiUrl)
.post(mocks.responses.autocompleteUrl, <any>autocompleteQuery)
.post(mocks.responses.autocompleteUrl, autocompleteQuery as any)
.reply(response.status, response.responseText, response.responseHeaders);
});

Expand Down

0 comments on commit 055e0d3

Please sign in to comment.