Skip to content

Commit

Permalink
fix: look at all test files to resolve dirty tests (#7045)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone authored Jul 25, 2024
1 parent 44c4ad0 commit 7d542f6
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 106 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
parserOptions: {
ecmaVersion: 2023, // Allows for the parsing of modern ECMAScript features
sourceType: "module", // Allows for the use of imports
project: "./tsconfig.eslint.json",
project: "./tsconfig.all.json",
tsconfigRootDir: __dirname,
},
extends: [
Expand Down
11 changes: 0 additions & 11 deletions find-borked-tests.sh

This file was deleted.

40 changes: 0 additions & 40 deletions jest2ava.sh

This file was deleted.

4 changes: 2 additions & 2 deletions packages/core/src/values/Primitive.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
MAX_NODES,
MAX_NODES_LR,
NUM_LR_NODES_PER_SEGMENT,
NUM_NODEMASK_BYTES,
} from "../consts";
Expand Down Expand Up @@ -287,7 +287,7 @@ export function parseLongRangeNodeBitMask(
}

export function encodeNodeBitMask(nodeIDs: readonly number[]): Buffer {
return encodeBitMask(nodeIDs, MAX_NODES);
return encodeBitMask(nodeIDs, MAX_NODES_LR);
}

export function encodeLongRangeNodeBitMask(
Expand Down
2 changes: 1 addition & 1 deletion packages/maintenance/src/codefind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ function getCodePathAtPosition(
}

export function codefind(query: CodeFindQuery): Result[] {
const tsConfig = loadTSConfig("zwave-js", false);
const tsConfig = loadTSConfig(undefined, "all");
const program = ts.createProgram(tsConfig.fileNames, {
...tsConfig.options,
preserveSymlinks: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/maintenance/src/resolveDirtyTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export async function resolveDirtyTests(
// Create a Program to represent the project, then pull out the
// source file to parse its AST.

const tsConfig = loadTSConfig(undefined, false);
const tsConfig = loadTSConfig(undefined, "all");
const program = ts.createProgram(tsConfig.fileNames, {
...tsConfig.options,
preserveSymlinks: false,
Expand Down
6 changes: 4 additions & 2 deletions packages/maintenance/src/tsAPITools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const tsConfigFilePathForDocs = path.join(

export function loadTSConfig(
packageName: string = "",
build: boolean = true,
variant: string = "build",
): {
options: ts.CompilerOptions;
fileNames: string[];
Expand All @@ -25,7 +25,7 @@ export function loadTSConfig(
packageName ? path.join(repoRoot, `packages/${packageName}`) : repoRoot,
// eslint-disable-next-line @typescript-eslint/unbound-method
ts.sys.fileExists,
build ? "tsconfig.build.json" : "tsconfig.json",
variant ? `tsconfig.${variant}.json` : "tsconfig.json",
);
if (!configFileName) throw new Error("tsconfig.json not found");

Expand All @@ -39,6 +39,8 @@ export function loadTSConfig(
);
if (!parsedCommandLine) throw new Error("could not parse tsconfig.json");

// FIXME: If parsedCommandLine contains project references, but no fileNames, we need to resolve the references

return {
options: parsedCommandLine.options,
fileNames: parsedCommandLine.fileNames,
Expand Down
40 changes: 0 additions & 40 deletions test.ts

This file was deleted.

7 changes: 7 additions & 0 deletions tsconfig.all.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Custom tsconfig that includes all `.ts` files in the repo
// This is used for linting and other maintenance tasks
{
"extends": "./tsconfig.base.json",
"include": ["**/*.ts"],
"exclude": ["**/build/**", "**/node_modules/**"]
}
6 changes: 0 additions & 6 deletions tsconfig.eslint.json

This file was deleted.

4 changes: 2 additions & 2 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
// The style based linting tasks depend on the corresponding configuration in the repo root
"../../.eslintrc.js",
"../../.eslintignore",
"../../tsconfig.eslint.json"
"../../tsconfig.all.json"
]
},
"lint:ts:fix": {
Expand All @@ -65,7 +65,7 @@
// The style based linting tasks depend on the corresponding configuration in the repo root
"../../.eslintrc.js",
"../../.eslintignore",
"../../tsconfig.eslint.json"
"../../tsconfig.all.json"
],
"outputs": ["**/*.{ts,json}"]
},
Expand Down

0 comments on commit 7d542f6

Please sign in to comment.