@arktype/attest
Advanced tools
Comparing version 0.7.10 to 0.8.0
@@ -1,5 +0,5 @@ | ||
import type { BenchAssertionContext, BenchContext } from "./bench.js"; | ||
import type { BenchContext } from "./bench.js"; | ||
import { type MarkMeasure, type Measure, type MeasureComparison } from "./measure.js"; | ||
export declare const queueBaselineUpdateIfNeeded: (updated: Measure | MarkMeasure, baseline: Measure | MarkMeasure | undefined, ctx: BenchAssertionContext) => void; | ||
export declare const queueBaselineUpdateIfNeeded: (updated: Measure | MarkMeasure, baseline: Measure | MarkMeasure | undefined, ctx: BenchContext) => void; | ||
/** Pretty print comparison and set the process.exitCode to 1 if delta threshold is exceeded */ | ||
export declare const compareToBaseline: (result: MeasureComparison, ctx: BenchContext) => void; |
import { snapshot } from "@arktype/util"; | ||
import { AssertionError } from "node:assert"; | ||
import process from "node:process"; | ||
@@ -43,7 +44,12 @@ import { queueSnapshotUpdate, writeSnapshotUpdatesOnExit } from "../cache/snapshots.js"; | ||
if (ctx.cfg.benchErrorOnThresholdExceeded) { | ||
process.exitCode = 1; | ||
// Summarize failures at the end of output | ||
process.on("exit", () => { | ||
console.error(`❌ ${message}`); | ||
}); | ||
const errorSummary = `❌ ${message}`; | ||
if (ctx.kind === "instantiations") | ||
throw new AssertionError({ message: errorSummary }); | ||
else { | ||
process.exitCode = 1; | ||
// Summarize failures at the end of output | ||
process.on("exit", () => { | ||
console.error(errorSummary); | ||
}); | ||
} | ||
} | ||
@@ -50,0 +56,0 @@ }; |
@@ -54,4 +54,2 @@ import { type SourcePosition } from "@arktype/fs"; | ||
isAsync: boolean; | ||
}; | ||
export type BenchAssertionContext = BenchContext & { | ||
kind: TimeAssertionName | "types" | "instantiations"; | ||
@@ -58,0 +56,0 @@ }; |
import type { TypeRelationship } from "../cache/writeAssertionCache.js"; | ||
import type { BenchAssertionContext, BenchContext } from "./bench.js"; | ||
import type { BenchContext } from "./bench.js"; | ||
import { type Measure, type TypeUnit } from "./measure.js"; | ||
@@ -16,2 +16,2 @@ export type BenchTypeAssertions = { | ||
}; | ||
export declare const instantiationDataHandler: (ctx: BenchAssertionContext, args?: Measure<TypeUnit>, isBenchFunction?: boolean) => void; | ||
export declare const instantiationDataHandler: (ctx: BenchContext, args?: Measure<TypeUnit>, isBenchFunction?: boolean) => void; |
@@ -76,3 +76,3 @@ import { flatMorph } from "@arktype/util"; | ||
} | ||
return flatMorph(completions, (prefix, entries) => entries.length >= 1 ? [prefix, entries] : []); | ||
return flatMorph(completions, (prefix, entries) => entries.length >= 1 ? [prefix, entries.sort()] : []); | ||
}; | ||
@@ -79,0 +79,0 @@ export const getDiagnosticsByFile = () => { |
@@ -14,5 +14,5 @@ import { ensureDir, fromCwd } from "@arktype/fs"; | ||
benchPercentThreshold: 20, | ||
benchErrorOnThresholdExceeded: false, | ||
benchErrorOnThresholdExceeded: true, | ||
filter: undefined, | ||
testDeclarationAliases: ["bench", "it"], | ||
testDeclarationAliases: ["bench", "it", "test"], | ||
formatter: `npm exec --no -- prettier --write`, | ||
@@ -19,0 +19,0 @@ shouldFormat: true |
{ | ||
"name": "@arktype/attest", | ||
"version": "0.7.10", | ||
"version": "0.8.0", | ||
"author": { | ||
@@ -10,6 +10,6 @@ "name": "David Blass", | ||
"type": "module", | ||
"main": "./out/api.js", | ||
"types": "./out/api.d.ts", | ||
"main": "./out/index.js", | ||
"types": "./out/index.d.ts", | ||
"exports": { | ||
".": "./out/api.js", | ||
".": "./out/index.js", | ||
"./internal/*": "./out/*" | ||
@@ -25,6 +25,6 @@ }, | ||
"arktype": "latest", | ||
"@typescript/vfs": "1.5.0", | ||
"@typescript/vfs": "1.5.3", | ||
"@typescript/analyze-trace": "0.10.1", | ||
"@arktype/fs": "0.0.20", | ||
"@arktype/util": "0.0.48" | ||
"@arktype/util": "0.0.49" | ||
}, | ||
@@ -31,0 +31,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
131289
4185
+ Added@arktype/util@0.0.49(transitive)
+ Added@typescript/vfs@1.5.3(transitive)
- Removed@arktype/util@0.0.48(transitive)
- Removed@typescript/vfs@1.5.0(transitive)
Updated@arktype/util@0.0.49
Updated@typescript/vfs@1.5.3