feat: bump versions
This commit is contained in:
parent
e45fa5ea7a
commit
3270822cc1
3 changed files with 2270 additions and 1443 deletions
|
@ -1,6 +1,6 @@
|
|||
import axios from "axios";
|
||||
import { LhispOauthClient } from "../src/lhisp-oauth-client";
|
||||
import { ContentType, LhispOauthClientConstructorParams, defaultAuthContentType } from "../src/lhisp-oauth-client.t";
|
||||
import { ContentType, LhispOauthClientConstructorParams } from "../src/lhisp-oauth-client.t";
|
||||
|
||||
// Mock jest and set the type
|
||||
jest.mock("axios");
|
||||
|
@ -35,7 +35,7 @@ describe("Get Access Token", () => {
|
|||
authHeaderName: "CustomAuthorizationHeader",
|
||||
});
|
||||
await accessTokenValidator(cli);
|
||||
expect(mockedAxios.request).toBeCalledWith(
|
||||
expect(mockedAxios.request).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
url: authUrl,
|
||||
method: "POST",
|
||||
|
@ -54,7 +54,7 @@ describe("Get Access Token", () => {
|
|||
grantType: "PermissaoCustom",
|
||||
});
|
||||
await accessTokenValidator(cli);
|
||||
expect(mockedAxios.request).toBeCalledWith(
|
||||
expect(mockedAxios.request).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
url: authUrl,
|
||||
method: "POST",
|
||||
|
@ -73,7 +73,7 @@ describe("Get Access Token", () => {
|
|||
authScope: "EscopoCustom",
|
||||
});
|
||||
await accessTokenValidator(cli);
|
||||
expect(mockedAxios.request).toBeCalledWith(
|
||||
expect(mockedAxios.request).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
url: authUrl,
|
||||
method: "POST",
|
||||
|
@ -93,7 +93,7 @@ describe("Get Access Token", () => {
|
|||
sendAuthCredentialsOnRequestBody: true,
|
||||
});
|
||||
await accessTokenValidator(cli);
|
||||
expect(mockedAxios.request).toBeCalledWith(
|
||||
expect(mockedAxios.request).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
url: authUrl,
|
||||
method: "POST",
|
||||
|
@ -118,7 +118,7 @@ describe("Request", () => {
|
|||
const cli = getOauthClient();
|
||||
const resp = await cli.get({ path: "/my-test-url" });
|
||||
validateDefaultGetAccessToken();
|
||||
expect(mockedAxios.request).toBeCalledWith(
|
||||
expect(mockedAxios.request).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
url: `${apiUrl}/my-test-url`,
|
||||
method: "GET",
|
||||
|
@ -136,7 +136,7 @@ describe("Request", () => {
|
|||
const cli = getOauthClient();
|
||||
const resp = await cli.get({ path: "/my-test-url", params: { id: 1 } });
|
||||
validateDefaultGetAccessToken();
|
||||
expect(mockedAxios.request).toBeCalledWith(
|
||||
expect(mockedAxios.request).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
url: `${apiUrl}/my-test-url`,
|
||||
method: "GET",
|
||||
|
@ -155,7 +155,7 @@ describe("Request", () => {
|
|||
const cli = getOauthClient();
|
||||
const resp = await cli.post({ path: "/my-test-url-post", data: { id: 1, user: "test" } });
|
||||
validateDefaultGetAccessToken();
|
||||
expect(mockedAxios.request).toBeCalledWith(
|
||||
expect(mockedAxios.request).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
url: `${apiUrl}/my-test-url-post`,
|
||||
method: "POST",
|
||||
|
@ -177,7 +177,7 @@ describe("Request", () => {
|
|||
contentType: ContentType.APPLICATION_X_WWW_FORM_URLENCODED,
|
||||
});
|
||||
validateDefaultGetAccessToken();
|
||||
expect(mockedAxios.request).toBeCalledWith(
|
||||
expect(mockedAxios.request).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
url: `${apiUrl}/my-test-url-post`,
|
||||
method: "POST",
|
||||
|
@ -202,7 +202,7 @@ describe("Request", () => {
|
|||
contentType: ContentType.APPLICATION_X_WWW_FORM_URLENCODED,
|
||||
});
|
||||
validateDefaultGetAccessToken();
|
||||
expect(mockedAxios.request).toBeCalledWith(
|
||||
expect(mockedAxios.request).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
url: `${apiUrl}/my-test-url-post`,
|
||||
method: "POST",
|
||||
|
@ -218,7 +218,7 @@ describe("Request", () => {
|
|||
});
|
||||
|
||||
function validateDefaultGetAccessToken() {
|
||||
expect(mockedAxios.request).toBeCalledWith(
|
||||
expect(mockedAxios.request).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
url: authUrl,
|
||||
method: "POST",
|
||||
|
|
3677
package-lock.json
generated
3677
package-lock.json
generated
File diff suppressed because it is too large
Load diff
14
package.json
14
package.json
|
@ -15,14 +15,14 @@
|
|||
"test:watch": "jest --watchAll"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.8",
|
||||
"@types/node": "^20.9.0",
|
||||
"jest": "^29.7.0",
|
||||
"ts-jest": "^29.1.1",
|
||||
"typescript": "^5.2.2"
|
||||
"@types/jest": "^30.0.0",
|
||||
"@types/node": "^24.0.4",
|
||||
"jest": "^30.0.3",
|
||||
"ts-jest": "^29.4.0",
|
||||
"typescript": "^5.8.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.6.1",
|
||||
"lhisp-logger": "^1.0.14"
|
||||
"axios": "^1.10.0",
|
||||
"lhisp-logger": "^1.0.16"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue