Files
http-client/jest.config.cjs
T
levaliciousandClaude Opus 5.5 97070f6c1d [LevK]: Build and test as a standalone package
Split out of actions/toolkit (packages/http-client, history kept by filter-repo).
Brings the 2024 [LevK] packaging edits forward onto current upstream:

- tsconfig.json: the monorepo root's compiler options inlined, no extends
- jest.config.cjs: the root's ts-jest transform, rooted at tests/
  (isolatedModules: ESM lib/ and sources run through CommonJS)
- __tests__/ -> tests/
- package.json: test = jest, build = tsc; jest/ts-jest/typescript as
  devDependencies; repository, homepage, bugs on git.levk.dev
- .gitignore: node_modules/, lib/, audit.json
- HttpCodes.PayloadTooLarge = 413 (the 2024 edit; still missing upstream)

Not carried over from 2024: the _getExistingOrDefaultHeader type
narrowing (upstream has since fixed it properly), version reset to 1.0.0 (dependents' ranges
need upstream's numbering) and the Unlicense field (the code is MIT).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UHXzGrsxfkGk8LmwrBbHNZ
2026-10-12 15:01:27 -04:00

25 lines
552 B
JavaScript

/** @type {import('jest').Config} */
module.exports = {
clearMocks: true,
moduleFileExtensions: ['js', 'ts'],
testEnvironment: 'node',
roots: ['<rootDir>/tests'],
testMatch: ['**/*.test.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1'
},
transform: {
'^.+\\.(ts|js)$': ['ts-jest', {
diagnostics: {warnOnly: true},
tsconfig: {
allowJs: true,
isolatedModules: true,
esModuleInterop: true,
module: 'commonjs',
moduleResolution: 'node'
}
}]
},
verbose: true
}