[project] Decouple integration testing from the CI workflow.

This commit is contained in:
Revone 2023-11-01 18:19:49 +08:00
parent e9f2359365
commit 68aa49f9b1
8 changed files with 50 additions and 44 deletions

View file

@ -8,7 +8,7 @@ All notable changes to this project will be documented in this file.
- [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
- [`auto-changelog`](https://github.com/CookPete/auto-changelog)
## [v1.41.1](https://github.com/zrwusa/data-structure-typed/compare/v1.35.0...main) (upcoming)
## [v1.41.2](https://github.com/zrwusa/data-structure-typed/compare/v1.35.0...main) (upcoming)
### Changes

View file

@ -4,5 +4,6 @@ module.exports = {
testMatch: ['<rootDir>/test/**/*.test.ts', '<rootDir>/test/**/*.test.js'],
collectCoverage: true,
coverageReporters: ['clover', 'json', 'lcov', ['text', {skipFull: true}], "json-summary"],
coverageDirectory: 'coverage'
coverageDirectory: 'coverage',
testPathIgnorePatterns: ['<rootDir>/test/integration/']
};

View file

@ -0,0 +1,5 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['<rootDir>/test/integration/**/*.test.ts', '<rootDir>/test/integration/**/*.test.js'],
};

50
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "data-structure-typed",
"version": "1.41.1",
"version": "1.41.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "data-structure-typed",
"version": "1.41.1",
"version": "1.41.2",
"license": "MIT",
"devDependencies": {
"@types/benchmark": "^2.1.3",
@ -15,17 +15,17 @@
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"auto-changelog": "^2.4.0",
"avl-tree-typed": "^1.41.0",
"avl-tree-typed": "^1.41.1",
"benchmark": "^2.1.4",
"binary-tree-typed": "^1.41.0",
"bst-typed": "^1.41.0",
"binary-tree-typed": "^1.41.1",
"bst-typed": "^1.41.1",
"dependency-cruiser": "^14.1.0",
"eslint": "^8.50.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.28.1",
"heap-typed": "^1.41.0",
"heap-typed": "^1.41.1",
"istanbul-badges-readme": "^1.8.5",
"jest": "^29.7.0",
"prettier": "^3.0.3",
@ -2728,12 +2728,12 @@
}
},
"node_modules/avl-tree-typed": {
"version": "1.41.0",
"resolved": "https://registry.npmjs.org/avl-tree-typed/-/avl-tree-typed-1.41.0.tgz",
"integrity": "sha512-fY0TV30CtWSqLUFeT4fiyrYNSiwXjHL5hObSTE8D8ngWxLsL4QPGVL5lA3VXAPiul3BRJK22s9klVc4YZgdgYQ==",
"version": "1.41.1",
"resolved": "https://registry.npmjs.org/avl-tree-typed/-/avl-tree-typed-1.41.1.tgz",
"integrity": "sha512-uDby1QfHHFdDBDHlAHy0yLbzyv5EaqkJh2K7SRABLtdH1vFwEnyrEDYuVbnzt3WQpng6EnJQ/JJbuQTUw1bXHQ==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.41.0"
"data-structure-typed": "^1.41.1"
}
},
"node_modules/babel-jest": {
@ -2927,12 +2927,12 @@
}
},
"node_modules/binary-tree-typed": {
"version": "1.41.0",
"resolved": "https://registry.npmjs.org/binary-tree-typed/-/binary-tree-typed-1.41.0.tgz",
"integrity": "sha512-oNHXYVGP2k+qqs1CKt7MFL9araGeFgBhUwIwaE0mj2eHKn2iitirpwt2Umo6j0xXbe2HT685T2POsN8BurXAJw==",
"version": "1.41.1",
"resolved": "https://registry.npmjs.org/binary-tree-typed/-/binary-tree-typed-1.41.1.tgz",
"integrity": "sha512-DF64S/WE8kls21iutKQJfJmIJ/C4s7mFg6yQ7KFM2FCyvsQ3sGVUnOmbu7JQF4lEdDcEgu6YueODVchhEjxdKw==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.41.0"
"data-structure-typed": "^1.41.1"
}
},
"node_modules/brace-expansion": {
@ -3011,12 +3011,12 @@
}
},
"node_modules/bst-typed": {
"version": "1.41.0",
"resolved": "https://registry.npmjs.org/bst-typed/-/bst-typed-1.41.0.tgz",
"integrity": "sha512-H/MOPuXC53SMo4KleIYFstc3a/GLDVVXShSTG9qrHN2QavZOeg6qyfpkvzOTRyCYjcNlPqMXiwPUtXSaLwH1WA==",
"version": "1.41.1",
"resolved": "https://registry.npmjs.org/bst-typed/-/bst-typed-1.41.1.tgz",
"integrity": "sha512-YfKna3z8aBhT0EiVZ26i3Ui9VIYg+J+oPYl1oTAK2n74GwDBwOXnP6HRibaB09nB/NuHt9cL6+IXyDc0P3V8vg==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.41.0"
"data-structure-typed": "^1.41.1"
}
},
"node_modules/buffer-from": {
@ -3413,9 +3413,9 @@
}
},
"node_modules/data-structure-typed": {
"version": "1.41.0",
"resolved": "https://registry.npmjs.org/data-structure-typed/-/data-structure-typed-1.41.0.tgz",
"integrity": "sha512-f122SHhf5c0CscW9TFpRmwxQeSemnvAvDG0ZbihA0MDkzTozox47iN3lt2CwjEmWvx73WwOABb1JvmiUZI07og==",
"version": "1.41.1",
"resolved": "https://registry.npmjs.org/data-structure-typed/-/data-structure-typed-1.41.1.tgz",
"integrity": "sha512-Upx3HQc+bsa5YtWGmmeBEoVN3i1onF1GacKX0vvjNQiXZoR93WwnJBISTlM/GO5vRmkproZ6FXKJzyEjKRY8bQ==",
"dev": true
},
"node_modules/debug": {
@ -4771,12 +4771,12 @@
}
},
"node_modules/heap-typed": {
"version": "1.41.0",
"resolved": "https://registry.npmjs.org/heap-typed/-/heap-typed-1.41.0.tgz",
"integrity": "sha512-ZhEqBuu+T4Vkd0K1xZRNpXWVvF/Uy+bYocZo2ZkgnPJ3gGtqBLmoE7MXEPtZxgH6dfrybVvtBLhAsCIqpjp2Lw==",
"version": "1.41.1",
"resolved": "https://registry.npmjs.org/heap-typed/-/heap-typed-1.41.1.tgz",
"integrity": "sha512-TadRqSZCJG/Q9nRI2eThwpQBjIPpbTjkmGaAWu4ud3tKKOAyqFF4+HCtXRQZB2LY5sWmlY1tS/pe7g7AOq/q/Q==",
"dev": true,
"dependencies": {
"data-structure-typed": "^1.41.0"
"data-structure-typed": "^1.41.1"
}
},
"node_modules/html-escaper": {

View file

@ -1,6 +1,6 @@
{
"name": "data-structure-typed",
"version": "1.41.1",
"version": "1.41.2",
"description": "Data Structures of Javascript & TypeScript. Binary Tree, BST, Graph, Heap, Priority Queue, Linked List, Queue, Deque, Stack, AVL Tree, Tree Multiset, Trie, Directed Graph, Undirected Graph, Singly Linked List, Doubly Linked List, Max Heap, Max Priority Queue, Min Heap, Min Priority Queue.",
"main": "dist/cjs/index.js",
"module": "dist/mjs/index.js",
@ -32,10 +32,11 @@
"update:subs": "npm i avl-tree-typed binary-tree-typed bst-typed heap-typed --save-dev",
"install:all-subs": "npm i avl-tree-typed binary-tree-typed bst-typed deque-typed directed-graph-typed doubly-linked-list-typed graph-typed heap-typed linked-list-typed max-heap-typed max-priority-queue-typed min-heap-typed min-priority-queue-typed priority-queue-typed singly-linked-list-typed stack-typed tree-multiset-typed trie-typed undirected-graph-typed queue-typed --save-dev",
"test": "jest",
"test:integration": "npm run update:subs && jest --config jest.integration.config.js",
"check:deps": "dependency-cruiser src",
"changelog": "auto-changelog",
"coverage:badge": "istanbul-badges-readme",
"ci": "env && git fetch --tags && npm run check && npm run lint && npm run build && npm run update:subs && npm run test && npm run changelog",
"ci": "env && git fetch --tags && npm run check && npm run lint && npm run build && npm run test && npm run changelog",
"copy:to-subs": "sh scripts/copy_to_all_subs.sh",
"publish:subs": "npm run copy:to-subs && sh scripts/publish_all_subs.sh",
"publish:docs": "sh scripts/publish_docs.sh",
@ -61,17 +62,17 @@
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"auto-changelog": "^2.4.0",
"avl-tree-typed": "^1.41.0",
"avl-tree-typed": "^1.41.1",
"benchmark": "^2.1.4",
"binary-tree-typed": "^1.41.0",
"bst-typed": "^1.41.0",
"binary-tree-typed": "^1.41.1",
"bst-typed": "^1.41.1",
"dependency-cruiser": "^14.1.0",
"eslint": "^8.50.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.28.1",
"heap-typed": "^1.41.0",
"heap-typed": "^1.41.1",
"istanbul-badges-readme": "^1.8.5",
"jest": "^29.7.0",
"prettier": "^3.0.3",

View file

@ -7,7 +7,6 @@
*/
import {RBTNColor} from '../../types';
import * as console from 'console';
export class RBTreeNode {
key: number;

View file

@ -12,13 +12,13 @@ describe('AVL Tree Test', () => {
expect(node6 && tree.getHeight(node6)).toBe(3);
expect(node6 && tree.getDepth(node6)).toBe(1);
const getNodeById = tree.get(10);
expect(getNodeById?.key).toBe(10);
const getValueById = tree.get(10);
expect(getValueById).toBe(10);
const getMinNodeByRoot = tree.getLeftMost();
expect(getMinNodeByRoot?.key).toBe(1);
const node15 = tree.get(15);
const node15 = tree.getNode(15);
const getMinNodeBySpecificNode = node15 && tree.getLeftMost(node15);
expect(getMinNodeBySpecificNode?.key).toBe(12);

View file

@ -20,16 +20,16 @@ describe('Individual package BST operations test', () => {
expect(node6 && bst.getHeight(6)).toBe(2);
expect(node6 && bst.getDepth(6)).toBe(3);
const nodeId10 = bst.get(10);
const nodeId10 = bst.getNode(10);
expect(nodeId10?.key).toBe(10);
const nodeVal9 = bst.get(9, node => node.value);
const nodeVal9 = bst.getNode(9, node => node.value);
expect(nodeVal9?.key).toBe(9);
const leftMost = bst.getLeftMost();
expect(leftMost?.key).toBe(1);
const node15 = bst.get(15);
const node15 = bst.getNode(15);
const minNodeBySpecificNode = node15 && bst.getLeftMost(node15);
expect(minNodeBySpecificNode?.key).toBe(12);
@ -43,7 +43,7 @@ describe('Individual package BST operations test', () => {
expect(node15).toBeInstanceOf(BSTNode);
const node11 = bst.get(11);
const node11 = bst.getNode(11);
expect(node11).toBeInstanceOf(BSTNode);
const dfsInorderNodes = bst.dfs(node => node, 'in');
@ -216,7 +216,7 @@ describe('Individual package BST operations test', () => {
expect(objBST.has(6)).toBe(true);
const node6 = objBST.get(6);
const node6 = objBST.getNode(6);
expect(node6 && objBST.getHeight(node6)).toBe(2);
expect(node6 && objBST.getDepth(node6)).toBe(3);
@ -229,7 +229,7 @@ describe('Individual package BST operations test', () => {
const leftMost = objBST.getLeftMost();
expect(leftMost?.key).toBe(1);
const node15 = objBST.get(15);
const node15 = objBST.getNode(15);
expect(node15?.value).toEqual({key: 15, keyA: 15});
const minNodeBySpecificNode = node15 && objBST.getLeftMost(node15);
expect(minNodeBySpecificNode?.key).toBe(12);
@ -244,7 +244,7 @@ describe('Individual package BST operations test', () => {
expect(node15).toBeInstanceOf(BSTNode);
const node11 = objBST.get(11);
const node11 = objBST.getNode(11);
expect(node11).toBeInstanceOf(BSTNode);
const dfsInorderNodes = objBST.dfs(node => node, 'in');