Skip to content

Commit 656ee99

Browse files
committed
Move tests in test
1 parent 2c911b8 commit 656ee99

7 files changed

Lines changed: 10 additions & 10 deletions

File tree

actions/gls-action/src/definitions/functions/reprintParcel.test.ts renamed to actions/gls-action/test/definitions/functions/reprintParcel.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import {HerculesFunctionContext} from "@code0-tech/hercules";
33
import {
44
ReprintParcelResponseData,
55
ReprintParcelResponseDataSchema
6-
} from "../datatypes/glsReprintParcel";
7-
import {withBaseFunctionMock} from "../../__tests__/withBaseFunction";
8-
import {AuthenticationResponseData} from "../../types/definitions/auth";
6+
} from "../../../src/definitions/datatypes/glsReprintParcel";
7+
import {withBaseFunctionMock} from "../../helpers/withBaseFunction";
8+
import {AuthenticationResponseData} from "../../../src/types/definitions/auth";
99

1010
const mockRequestData = {
1111
CreationDate: "2024-01-01T00:00:00Z",
@@ -77,7 +77,7 @@ describe("reprintParcel.ts", () => {
7777
});
7878

7979
it("registers function definitions and calls API endpoints correctly", async () => {
80-
const {register} = await import("./reprintParcel");
80+
const {register} = await import("../../../src/definitions/functions/reprintParcel");
8181

8282
await withBaseFunctionMock(register, async (state) => {
8383
expect(state.registeredFunctionDefinitions).toHaveLength(1);
File renamed without changes.
File renamed without changes.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
HerculesFlowType,
66
HerculesRegisterFunctionParameter
77
} from "@code0-tech/hercules";
8-
import {withSdkMock} from "./__tests__/withSdkMock";
8+
import {withSdkMock} from "./helpers/withSdkMock";
99

1010
export type SdkMockState = {
1111
registeredFunctionDefinitions: HerculesRegisterFunctionParameter[] | null;
@@ -69,7 +69,7 @@ describe("withSdkMock", () => {
6969

7070
it('should be valid', async () => {
7171
vi.resetModules(); // clear module cache
72-
await import("./index"); // now it runs
72+
await import("../src"); // now it runs
7373

7474
state.dataTypes?.forEach((dataType: HerculesDataType) => {
7575
expect(dataType.identifier.startsWith("GLS_"), `${dataType.identifier}: Identifier should start with GLS_`).toBeTruthy()

actions/gls-action/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
"compilerOptions": {
44
"outDir": "dist"
55
},
6-
"include": ["src"],
7-
"exclude": ["node_modules", "dist", "***/__tests__/**", "**/*.test.ts"]
6+
"include": ["src"]
87
}

tsconfig.base.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
"skipLibCheck": true,
1010
"types": ["vite/client"]
1111
},
12-
"include": ["src/**/*"]
12+
"include": ["src/**/*"],
13+
"exclude": ["node_modules", "dist", "***/test/**", "**/*.test.ts"]
1314
}

vitest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {defineConfig} from "vitest/config";
22

33
export default defineConfig({
44
test: {
5-
include: ["actions/**/src/**/*.{test,spec}.{ts,tsx}"],
5+
include: ["actions/**/*.{test,spec}.{ts,tsx}"],
66
environment: "node",
77
exclude: ['**/dist/**'],
88
},

0 commit comments

Comments
 (0)