diff --git a/scripts/bundles/testing.ts b/scripts/bundles/testing.ts index fb2312efc92..8e3f324fae7 100644 --- a/scripts/bundles/testing.ts +++ b/scripts/bundles/testing.ts @@ -55,7 +55,6 @@ export async function testing(opts: BuildOptions) { '@rollup/plugin-node-resolve', 'stream', 'tty', - 'typescript', 'url', 'util', 'vm', diff --git a/src/testing/jest/jest-preprocessor.ts b/src/testing/jest/jest-preprocessor.ts index 03114d794a2..8ea1ca185f3 100644 --- a/src/testing/jest/jest-preprocessor.ts +++ b/src/testing/jest/jest-preprocessor.ts @@ -1,7 +1,7 @@ import type { TranspileOptions, Diagnostic } from '@stencil/core/internal'; import { loadTypeScriptDiagnostic, normalizePath } from '@utils'; import { transpile } from '../test-transpile'; -import ts from 'typescript'; +import { ts } from '@stencil/core/compiler'; export const jestPreprocessor = { process(sourceText: string, filePath: string, jestConfig: { rootDir: string }) { @@ -44,7 +44,12 @@ export const jestPreprocessor = { return this._tsCompilerOptions; }, - getCacheKey(code: string, filePath: string, jestConfigStr: string, transformOptions: { instrument: boolean; rootDir: string }) { + getCacheKey( + code: string, + filePath: string, + jestConfigStr: string, + transformOptions: { instrument: boolean; rootDir: string }, + ) { // https://github.com/facebook/jest/blob/v23.6.0/packages/jest-runtime/src/script_transformer.js#L61-L90 if (!this._tsCompilerOptionsKey) { const opts = this.getCompilerOptions(transformOptions.rootDir); @@ -102,7 +107,13 @@ function getCompilerOptions(rootDir: string) { throw new Error(formatDiagnostic(loadTypeScriptDiagnostic(tsconfigResults.error))); } - const parseResult = ts.parseJsonConfigFileContent(tsconfigResults.config, ts.sys, rootDir, undefined, tsconfigFilePath); + const parseResult = ts.parseJsonConfigFileContent( + tsconfigResults.config, + ts.sys, + rootDir, + undefined, + tsconfigFilePath, + ); return parseResult.options; }