Skip to content

Commit

Permalink
fix: correct ts-jest config for importing mjs
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-sc committed Jan 24, 2024
1 parent 962f1b6 commit f5c54c5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
8 changes: 4 additions & 4 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import type {Config} from '@jest/types';
import {JestConfigWithTsJest} from 'ts-jest';

// Sync object
const config: Config.InitialOptions = {
preset: 'ts-jest',
const config: JestConfigWithTsJest = {
preset: 'ts-jest/presets/js-with-ts-esm',
testEnvironment: 'node',
verbose: false,
testMatch: undefined,
testRegex: '.*\.spec\.ts$',
collectCoverageFrom: ['src/**/*.ts'], // exclude coverage from schematic as it only collects from js (instead of ts)..
coveragePathIgnorePatterns: ['src/rmSafe.ts'],

transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
};
export default config;
9 changes: 6 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {TranslationFile, TranslationUnit} from './model/translationFileModels';
import {Merger} from './merger';
import {Options} from './options';
import {doCollapseWhitespace} from './stringUtils';
import {VERSION} from "@angular/core";
import {VERSION} from '@angular/core';


const STATE_INITIAL_XLF_2_0 = 'initial';
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
"allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */
"declaration": true, /* Generates corresponding '.d.ts' file. */
Expand Down

0 comments on commit f5c54c5

Please sign in to comment.