mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-13 06:20:23 -06:00
Skip incremental verification for alternate result test
This commit is contained in:
parent
3eb3e21021
commit
d6eb3d0484
@ -30,6 +30,7 @@ export interface TscWatchCompileChange<T extends ts.BuilderProgram = ts.EmitAndS
|
||||
export interface TscWatchCheckOptions {
|
||||
baselineSourceMap?: boolean;
|
||||
baselineDependencies?: boolean;
|
||||
skipIncrementalVerification?: true;
|
||||
}
|
||||
export interface TscWatchCompileBase<T extends ts.BuilderProgram = ts.EmitAndSemanticDiagnosticsBuilderProgram> extends TscWatchCheckOptions {
|
||||
scenario: string;
|
||||
@ -57,6 +58,7 @@ function tscWatchCompile(input: TscWatchCompile) {
|
||||
edits,
|
||||
baselineSourceMap,
|
||||
baselineDependencies,
|
||||
skipIncrementalVerification,
|
||||
} = input;
|
||||
ts.Debug.assert(isWatch(commandLineArgs), "use verifyTsc");
|
||||
const { cb, getPrograms } = commandLineCallbacks(sys);
|
||||
@ -74,6 +76,7 @@ function tscWatchCompile(input: TscWatchCompile) {
|
||||
getPrograms,
|
||||
baselineSourceMap,
|
||||
baselineDependencies,
|
||||
skipIncrementalVerification,
|
||||
edits,
|
||||
watchOrSolution,
|
||||
});
|
||||
@ -143,6 +146,7 @@ export function runWatchBaseline<T extends ts.BuilderProgram = ts.EmitAndSemanti
|
||||
baseline,
|
||||
baselineSourceMap,
|
||||
baselineDependencies,
|
||||
skipIncrementalVerification,
|
||||
edits,
|
||||
watchOrSolution,
|
||||
useSourceOfProjectReferenceRedirect,
|
||||
@ -155,6 +159,7 @@ export function runWatchBaseline<T extends ts.BuilderProgram = ts.EmitAndSemanti
|
||||
sys,
|
||||
baselineSourceMap,
|
||||
baselineDependencies,
|
||||
skipIncrementalVerification,
|
||||
});
|
||||
|
||||
if (edits) {
|
||||
@ -168,6 +173,7 @@ export function runWatchBaseline<T extends ts.BuilderProgram = ts.EmitAndSemanti
|
||||
sys,
|
||||
baselineSourceMap,
|
||||
baselineDependencies,
|
||||
skipIncrementalVerification,
|
||||
caption,
|
||||
resolutionCache: (watchOrSolution as ts.WatchOfConfigFile<T> | undefined)?.getResolutionCache?.(),
|
||||
useSourceOfProjectReferenceRedirect,
|
||||
@ -191,6 +197,7 @@ export function watchBaseline({
|
||||
sys,
|
||||
baselineSourceMap,
|
||||
baselineDependencies,
|
||||
skipIncrementalVerification,
|
||||
caption,
|
||||
resolutionCache,
|
||||
useSourceOfProjectReferenceRedirect,
|
||||
@ -205,7 +212,7 @@ export function watchBaseline({
|
||||
baselineDependencies,
|
||||
);
|
||||
// Verify program structure and resolution cache when incremental edit with tsc --watch (without build mode)
|
||||
if (resolutionCache && programs.length) {
|
||||
if (!skipIncrementalVerification && resolutionCache && programs.length) {
|
||||
ts.Debug.assert(programs.length === 1);
|
||||
verifyProgramStructureAndResolutionCache(
|
||||
caption!,
|
||||
|
||||
@ -197,6 +197,7 @@ export interface TestSessionOptions extends ts.server.SessionOptions, TestTyping
|
||||
disableAutomaticTypingAcquisition?: boolean;
|
||||
useCancellationToken?: boolean | number;
|
||||
regionDiagLineCountThreshold?: number;
|
||||
skipIncrementalVerification?: true;
|
||||
}
|
||||
export type TestSessionPartialOptionsAndHost =
|
||||
& Partial<Omit<TestSessionOptions, "typingsInstaller" | "cancellationToken">>
|
||||
@ -237,7 +238,7 @@ export class TestSession extends ts.server.Session {
|
||||
hrtime: process.hrtime,
|
||||
logger: opts.logger,
|
||||
canUseEvents: true,
|
||||
incrementalVerifier,
|
||||
incrementalVerifier: opts.skipIncrementalVerification ? undefined : incrementalVerifier,
|
||||
typesMapLocation: customTypesMap.path,
|
||||
typingsInstaller,
|
||||
...opts,
|
||||
|
||||
@ -540,6 +540,7 @@ describe("unittests:: tscWatch:: moduleResolution::", () => {
|
||||
sys,
|
||||
commandLineArgs: ["-w", "--extendedDiagnostics"],
|
||||
edits: edits(),
|
||||
skipIncrementalVerification: true,
|
||||
}),
|
||||
);
|
||||
|
||||
|
||||
@ -162,7 +162,7 @@ describe("unittests:: tsserver:: moduleResolution::", () => {
|
||||
it(scenario, () => {
|
||||
const host = getHost();
|
||||
const indexFile = "/home/src/projects/project/index.mts";
|
||||
const session = new TestSession(host);
|
||||
const session = new TestSession({ host, skipIncrementalVerification: true });
|
||||
openFilesForSession([indexFile], session);
|
||||
verifyGetErrRequest({ files: [indexFile], session });
|
||||
forEachTscWatchEdit(session, edits(), () => verifyGetErrRequest({ session, files: [indexFile] }));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user