Skip to content

Commit 06b31bb

Browse files
update versions and fix build issues: node, ts, eslint, typedoc, jest (#76)
* update versions: node, ts, eslint, typedoc * update versions: node, ts, eslint, typedoc * fix linter * fix TaskManager tests * fix TaskManager tests * add registerWorkflow inside TaskManager test * update dorny/test-reporter * remove secondary .env string in gitignore * TaskManager tests timings adjustment * fix linter errors * replace legacy method in TaskManager tests * Update TaskManager.test.ts * update ecma with 2024 * Update TaskManager.test.ts * registerTaskDef with retryCount 0 for TaskManager tests * Update TaskManager.test.ts * adjust schedulerExecutor test timing * support only node 18 and above * added jest-junit * Update yarn.lock
1 parent d361d40 commit 06b31bb

16 files changed

Lines changed: 2147 additions & 15379 deletions

.env

Whitespace-only changes.

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CONDUCTOR_SERVER_URL=""
2+
CONDUCTOR_AUTH_KEY=""
3+
CONDUCTOR_AUTH_SECRET=""

.eslintrc.js

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/pull_request.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,27 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- name: Checkout
10-
uses: actions/checkout@v3
10+
uses: actions/checkout@v4
1111
- name: Set up Node
12-
uses: actions/setup-node@v3
12+
uses: actions/setup-node@v4
1313
with:
14-
node-version: "18"
14+
node-version: "22"
1515
- name: Install package
16-
run: yarn install
16+
run: yarn install --frozen-lockfile
1717
- name: Run the linter
1818
run: yarn lint
1919

2020
unit-tests:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout
24-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2525
- name: Set up Node
26-
uses: actions/setup-node@v3
26+
uses: actions/setup-node@v4
2727
with:
28-
node-version: "18"
28+
node-version: "22"
2929
- name: Install package
30-
run: yarn install
30+
run: yarn install --frozen-lockfile
3131
- name: Run Tests
3232
run: yarn test --ci --reporters=default --reporters=jest-junit
3333
env:
@@ -36,7 +36,7 @@ jobs:
3636
CONDUCTOR_AUTH_SECRET: ${{ secrets.KEY_SECRET }}
3737
- name: Publish Test Results
3838
if: always()
39-
uses: dorny/test-reporter@v1
39+
uses: dorny/test-reporter@v2
4040
with:
4141
name: Test report
4242
path: reports/jest-*.xml

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@v3
12+
uses: actions/checkout@v4
1313
- name: Set up Node
14-
uses: actions/setup-node@v3
14+
uses: actions/setup-node@v4
1515
with:
16-
node-version: "18"
16+
node-version: "22"
1717
registry-url: "https://registry.npmjs.org"
1818
- name: Bump version to release
1919
run: sed -i "s/v0.0.0/$RELEASE_VERSION/" ./package.json
2020
env:
2121
RELEASE_VERSION: ${{ github.ref_name }}
2222
- name: Install dependencies required to build package
23-
run: yarn install
23+
run: yarn install --frozen-lockfile
2424
- name: Build package
2525
run: yarn build
2626
- name: Publish package

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
dist
2+
.env
23
# Logs
34
logs
45
*.log

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16.14.2
1+
22.18.0

eslint.config.mjs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import eslint from '@eslint/js';
2+
import tseslint from 'typescript-eslint';
3+
4+
export default tseslint.config(
5+
eslint.configs.recommended,
6+
tseslint.configs.recommended, // to remove
7+
//tseslint.configs.strict, // to add
8+
//tseslint.configs.stylistic, // to add
9+
{
10+
rules: {
11+
'@typescript-eslint/no-unused-vars': ['error', {
12+
argsIgnorePattern: '^_',
13+
varsIgnorePattern: '^_'
14+
}], //to remove
15+
'@typescript-eslint/explicit-function-return-type': 'off', // to remove
16+
'@typescript-eslint/explicit-module-boundary-types': 'off', // to remove
17+
'@typescript-eslint/no-explicit-any': 'off', // to remove
18+
'@typescript-eslint/no-wrapper-object-types': 'off', // to remove
19+
'@typescript-eslint/no-unsafe-function-type': 'off', // to remove
20+
},
21+
},
22+
{
23+
ignores: ['dist/**', 'src/common/open-api/**', 'docs/**', 'node_modules/**'],
24+
},
25+
);

jest.config.js

Lines changed: 8 additions & 185 deletions
Original file line numberDiff line numberDiff line change
@@ -1,197 +1,20 @@
1+
import 'dotenv/config';
2+
13
/*
24
* For a detailed explanation regarding each configuration property, visit:
35
* https://jestjs.io/docs/configuration
46
*/
57

6-
module.exports = {
7-
// All imported modules in your tests should be mocked automatically
8-
// automock: false,
8+
export default {
99
preset: 'ts-jest',
10-
11-
// Stop running tests after `n` failures
12-
// bail: 0,
13-
14-
// The directory where Jest should store its cached dependency information
15-
// cacheDirectory: "/private/var/folders/r5/s0779_114sj3t6j4m3mkn5xr0000gn/T/jest_dx",
16-
17-
// Automatically clear mock calls, instances, contexts and results before every test
1810
clearMocks: true,
19-
20-
// Indicates whether the coverage information should be collected while executing the test
21-
// collectCoverage: false,
22-
23-
// An array of glob patterns indicating a set of files for which coverage information should be collected
24-
// collectCoverageFrom: undefined,
25-
26-
// The directory where Jest should output its coverage files
27-
// coverageDirectory: undefined,
28-
29-
// An array of regexp pattern strings used to skip coverage collection
30-
// coveragePathIgnorePatterns: [
31-
// "/node_modules/"
32-
// ],
33-
34-
// Indicates which provider should be used to instrument code for coverage
3511
coverageProvider: "v8",
36-
37-
// A list of reporter names that Jest uses when writing coverage reports
38-
// coverageReporters: [
39-
// "json",
40-
// "text",
41-
// "lcov",
42-
// "clover"
43-
// ],
44-
45-
// An object that configures minimum threshold enforcement for coverage results
46-
// coverageThreshold: undefined,
47-
48-
// A path to a custom dependency extractor
49-
// dependencyExtractor: undefined,
50-
51-
// Make calling deprecated APIs throw helpful error messages
52-
// errorOnDeprecated: false,
53-
54-
// The default configuration for fake timers
55-
// fakeTimers: {
56-
// "enableGlobally": false
57-
// },
58-
59-
// Force coverage collection from ignored files using an array of glob patterns
60-
// forceCoverageMatch: [],
61-
62-
// A path to a module which exports an async function that is triggered once before all test suites
63-
// globalSetup: undefined,
64-
65-
// A path to a module which exports an async function that is triggered once after all test suites
66-
// globalTeardown: undefined,
67-
68-
// A set of global variables that need to be available in all test environments
69-
// globals: {},
70-
71-
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
72-
// maxWorkers: "50%",
73-
74-
// An array of directory names to be searched recursively up from the requiring module's location
75-
// moduleDirectories: [
76-
// "node_modules"
77-
// ],
78-
79-
// An array of file extensions your modules use
80-
// moduleFileExtensions: [
81-
// "js",
82-
// "mjs",
83-
// "cjs",
84-
// "jsx",
85-
// "ts",
86-
// "tsx",
87-
// "json",
88-
// "node"
89-
// ],
90-
91-
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
92-
// moduleNameMapper: {},
93-
94-
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
95-
// modulePathIgnorePatterns: [],
96-
97-
// Activates notifications for test results
98-
// notify: false,
99-
100-
// An enum that specifies notification mode. Requires { notify: true }
101-
// notifyMode: "failure-change",
102-
103-
// A preset that is used as a base for Jest's configuration
104-
// preset: undefined,
105-
106-
// Run tests from one or more projects
107-
// projects: undefined,
108-
109-
// Use this configuration option to add custom reporters to Jest
110-
// reporters: undefined,
111-
112-
// Automatically reset mock state before every test
113-
// resetMocks: false,
114-
115-
// Reset the module registry before running each individual test
116-
// resetModules: false,
117-
118-
// A path to a custom resolver
119-
// resolver: undefined,
120-
121-
// Automatically restore mock state and implementation before every test
122-
// restoreMocks: false,
123-
124-
// The root directory that Jest should scan for tests and modules within
125-
// rootDir: undefined,
126-
127-
// A list of paths to directories that Jest should use to search for files in
128-
// roots: [
129-
// "<rootDir>"
130-
// ],
131-
132-
// Allows you to use a custom runner instead of Jest's default test runner
133-
// runner: "jest-runner",
134-
135-
// The paths to modules that run some code to configure or set up the testing environment before each test
136-
// setupFiles: [],
137-
138-
// A list of paths to modules that run some code to configure or set up the testing framework before each test
139-
// setupFilesAfterEnv: [],
140-
141-
// The number of seconds after which a test is considered as slow and reported as such in the results.
142-
// slowTestThreshold: 5,
143-
144-
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
145-
// snapshotSerializers: [],
146-
147-
// The test environment that will be used for testing
148-
// testEnvironment: "jest-environment-node",
149-
150-
// Options that will be passed to the testEnvironment
151-
// testEnvironmentOptions: {},
152-
153-
// Adds a location field to test results
154-
// testLocationInResults: false,
155-
156-
// The glob patterns Jest uses to detect test files
15712
testMatch: [
15813
"**/__tests__/**/*.test.[jt]s?(x)",
15914
"**/?(*.)+(spec|test).[tj]s?(x)"
16015
],
161-
162-
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
163-
// testPathIgnorePatterns: [
164-
// "/node_modules/"
165-
// ],
166-
167-
// The regexp pattern or array of patterns that Jest uses to detect test files
168-
// testRegex: [],
169-
170-
// This option allows the use of a custom results processor
171-
// testResultsProcessor: undefined,
172-
173-
// This option allows use of a custom test runner
174-
// testRunner: "jest-circus/runner",
175-
176-
// A map from regular expressions to paths to transformers
177-
// transform: undefined,
178-
179-
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
180-
// transformIgnorePatterns: [
181-
// "/node_modules/",
182-
// "\\.pnp\\.[^\\/]+$"
183-
// ],
184-
185-
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
186-
// unmockedModulePathPatterns: undefined,
187-
188-
// Indicates whether each individual test should be reported during the run
189-
// verbose: undefined,
190-
191-
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
192-
// watchPathIgnorePatterns: [],
193-
194-
// Whether to use watchman for file crawling
195-
// watchman: true,
196-
};
197-
require('dotenv').config();
16+
transformIgnorePatterns: [
17+
"/node_modules/",
18+
"\\.pnp\\.[^\\/]+$"
19+
]
20+
};

0 commit comments

Comments
 (0)