forked from langchain-ai/langgraphjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(checkpoint-validation): cli fixes (langchain-ai#624)
- Loading branch information
1 parent
f3d5d74
commit 74ee400
Showing
9 changed files
with
74 additions
and
319 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
#!/usr/bin/env node | ||
import { register } from "node:module"; | ||
#!/usr/bin/env -S node --experimental-vm-modules | ||
import { main } from "../dist/cli.js"; | ||
|
||
register("@swc-node/register/esm", import.meta.url); | ||
|
||
await main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,40 @@ | ||
import { dirname, resolve as pathResolve } from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import { runCLI } from "@jest/core"; | ||
import type { Config } from "@jest/types"; | ||
|
||
import { parseArgs } from "./parse_args.js"; | ||
import { validateArgs } from "./parse_args.js"; | ||
|
||
export async function main() { | ||
const moduleDirname = dirname(fileURLToPath(import.meta.url)); | ||
const rootDir = pathResolve( | ||
dirname(fileURLToPath(import.meta.url)), | ||
"..", | ||
"dist" | ||
); | ||
const config: Config.Argv = { | ||
_: [pathResolve(rootDir, "runner.js")], | ||
$0: "", | ||
preset: "ts-jest/presets/default-esm", | ||
rootDir, | ||
testEnvironment: "node", | ||
testMatch: ["<rootDir>/runner.js"], | ||
transform: JSON.stringify({ | ||
"^.+\\.[jt]sx?$": "@swc/jest", | ||
}), | ||
moduleNameMapper: JSON.stringify({ | ||
"^(\\.{1,2}/.*)\\.[jt]sx?$": "$1", | ||
}), | ||
|
||
// jest ignores test files in node_modules by default. We want to run a test file that ships with this package, so | ||
// we disable that behavior here. | ||
testPathIgnorePatterns: [], | ||
haste: JSON.stringify({ | ||
retainAllFiles: true, | ||
}), | ||
}; | ||
|
||
// parse here to check for errors before running Jest | ||
await parseArgs(process.argv.slice(2)); | ||
export async function main() { | ||
// check for argument errors before running Jest | ||
await validateArgs(process.argv.slice(2)); | ||
|
||
await runCLI( | ||
{ | ||
_: [], | ||
$0: "", | ||
runInBand: true, | ||
}, | ||
[pathResolve(moduleDirname, "runtime_jest_config.js")] | ||
); | ||
await runCLI(config, [rootDir]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.