Skip to content

Commit 98c7685

Browse files
committed
fix test tsconfig and jest config
1 parent f566993 commit 98c7685

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

packages/replay/jest.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
import type { Config } from '@jest/types';
22
import { pathsToModuleNameMapper } from 'ts-jest';
33

4-
import { compilerOptions } from './tsconfig.json';
4+
import { compilerOptions } from './tsconfig.test.json';
55

66
export default async (): Promise<Config.InitialOptions> => {
77
return {
88
verbose: true,
99
preset: 'ts-jest/presets/js-with-ts', // needed when import worker.js
10+
globals: {
11+
'ts-jest': {
12+
tsconfig: '<rootDir>/tsconfig.test.json',
13+
},
14+
},
1015
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
1116
prefix: '<rootDir>/',
1217
}),

packages/replay/test/unit/util/isSampled.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { isSampled } from '../../../src/util/isSampled';
22

33
// Note Math.random generates a value from 0 (inclusive) to <1 (1 exclusive).
4-
const cases = [
4+
const cases: [number, number, boolean][] = [
55
[1.0, 0.9999, true],
66
[1.0, 0.0, true],
77
[1.0, 0.5, true],

packages/replay/tsconfig.test.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
"include": ["test/**/*.ts", "jest.config.ts", "jest.setup.ts"],
55

66
"compilerOptions": {
7-
"types": ["node", "jest"]
7+
"paths": {
8+
"@test": ["./test"],
9+
"@test/*": ["./test/*"]
10+
},
11+
"baseUrl": ".",
12+
"rootDir": ".",
13+
"types": ["node", "jest"],
14+
"noImplicitAny": false,
15+
"noImplicitThis": false,
16+
"strictPropertyInitialization": false
817
}
918
}

packages/replay/worker/src/Compressor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export class Compressor {
99
/**
1010
* Number of added events
1111
*/
12-
public added: number;
12+
public added: number = 0;
1313

1414
public constructor() {
1515
this.init();

0 commit comments

Comments
 (0)