diff --git a/code/lib/cli/src/js-package-manager/PNPMProxy.test.ts b/code/lib/cli/src/js-package-manager/PNPMProxy.test.ts
index e59bd7354bcc..fc89fd2b32f6 100644
--- a/code/lib/cli/src/js-package-manager/PNPMProxy.test.ts
+++ b/code/lib/cli/src/js-package-manager/PNPMProxy.test.ts
@@ -213,9 +213,14 @@ describe('PNPM Proxy', () => {
.spyOn(pnpmProxy, 'writePackageJson')
.mockImplementation(jest.fn());
+ const basePackageAttributes = {
+ dependencies: {},
+ devDependencies: {},
+ };
+
jest.spyOn(pnpmProxy, 'retrievePackageJson').mockImplementation(
- // @ts-expect-error (not strict)
- jest.fn(() => ({
+ jest.fn(async () => ({
+ ...basePackageAttributes,
overrides: {
bar: 'x.x.x',
},
@@ -228,6 +233,7 @@ describe('PNPM Proxy', () => {
await pnpmProxy.addPackageResolutions(versions);
expect(writePackageSpy).toHaveBeenCalledWith({
+ ...basePackageAttributes,
overrides: {
...versions,
bar: 'x.x.x',
diff --git a/code/renderers/react/src/docs/typeScript/handleProp.test.tsx b/code/renderers/react/src/docs/typeScript/handleProp.test.tsx
index 37527fd501df..a230f0229b5a 100644
--- a/code/renderers/react/src/docs/typeScript/handleProp.test.tsx
+++ b/code/renderers/react/src/docs/typeScript/handleProp.test.tsx
@@ -64,7 +64,7 @@ function extractPropDef(component: Component, rawDefaultProp?: any): PropDef {
describe('enhanceTypeScriptProp', () => {
describe('defaultValue', () => {
function createTestComponent(
- defaultValue: DocgenPropDefaultValue,
+ defaultValue: DocgenPropDefaultValue | undefined,
typeName = 'anything-is-fine'
): Component {
return createComponent({
@@ -295,8 +295,7 @@ describe('enhanceTypeScriptProp', () => {
});
it('should support strings', () => {
- // @ts-expect-error (not strict)
- const component = createTestComponent(null);
+ const component = createTestComponent(undefined);
const { defaultValue } = extractPropDef(component, 'foo');
@@ -305,8 +304,7 @@ describe('enhanceTypeScriptProp', () => {
});
it('should support array of primitives', () => {
- // @ts-expect-error (not strict)
- const component = createTestComponent(null);
+ const component = createTestComponent(undefined);
const { defaultValue } = extractPropDef(component, [1, 2, 3]);
@@ -315,8 +313,7 @@ describe('enhanceTypeScriptProp', () => {
});
it('should support array of short object', () => {
- // @ts-expect-error (not strict)
- const component = createTestComponent(null);
+ const component = createTestComponent(undefined);
const { defaultValue } = extractPropDef(component, [{ foo: 'bar' }]);
@@ -325,8 +322,7 @@ describe('enhanceTypeScriptProp', () => {
});
it('should support array of long object', () => {
- // @ts-expect-error (not strict)
- const component = createTestComponent(null);
+ const component = createTestComponent(undefined);
const { defaultValue } = extractPropDef(component, [{ foo: 'bar', bar: 'foo', hey: 'ho' }]);
@@ -342,8 +338,7 @@ describe('enhanceTypeScriptProp', () => {
});
it('should support short object', () => {
- // @ts-expect-error (not strict)
- const component = createTestComponent(null);
+ const component = createTestComponent(undefined);
const { defaultValue } = extractPropDef(component, { foo: 'bar' });
@@ -352,8 +347,7 @@ describe('enhanceTypeScriptProp', () => {
});
it('should support long object', () => {
- // @ts-expect-error (not strict)
- const component = createTestComponent(null);
+ const component = createTestComponent(undefined);
const { defaultValue } = extractPropDef(component, { foo: 'bar', bar: 'foo', hey: 'ho' });
@@ -369,8 +363,7 @@ describe('enhanceTypeScriptProp', () => {
});
it('should support anonymous function', () => {
- // @ts-expect-error (not strict)
- const component = createTestComponent(null);
+ const component = createTestComponent(undefined);
const { defaultValue } = extractPropDef(component, () => 'hey!');
@@ -379,8 +372,7 @@ describe('enhanceTypeScriptProp', () => {
});
it('should support named function', () => {
- // @ts-expect-error (not strict)
- const component = createTestComponent(null);
+ const component = createTestComponent(undefined);
const { defaultValue } = extractPropDef(component, function hello() {
return 'world!';
@@ -391,8 +383,7 @@ describe('enhanceTypeScriptProp', () => {
});
it('should support named function with params', () => {
- // @ts-expect-error (not strict)
- const component = createTestComponent(null);
+ const component = createTestComponent(undefined);
const { defaultValue } = extractPropDef(component, function add(a: number, b: number) {
return a + b;
@@ -403,8 +394,7 @@ describe('enhanceTypeScriptProp', () => {
});
it('should support React element', () => {
- // @ts-expect-error (not strict)
- const component = createTestComponent(null);
+ const component = createTestComponent(undefined);
const defaultProp =