[QRQC_2] No implicitAny in twenty-server (#12075)
# Introduction Following https://github.com/twentyhq/twenty/pull/12068 Related with https://github.com/twentyhq/core-team-issues/issues/975 We're enabling `noImplicitAny` handled few use case manually, added a `ts-expect-error` to the others, we should plan to handle them in the future
This commit is contained in:
@ -128,9 +128,11 @@ describe('Core REST API Create Many endpoint', () => {
|
||||
expect(createdPerson2.company.people).toBeDefined();
|
||||
|
||||
const depth2Person1 = createdPerson1.company.people.find(
|
||||
// @ts-expect-error legacy noImplicitAny
|
||||
(p) => p.id === createdPerson1.id,
|
||||
);
|
||||
const depth2Person2 = createdPerson2.company.people.find(
|
||||
// @ts-expect-error legacy noImplicitAny
|
||||
(p) => p.id === createdPerson2.id,
|
||||
);
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { TEST_COMPANY_1_ID } from 'test/integration/constants/test-company-ids.constants';
|
||||
import { TEST_PERSON_1_ID } from 'test/integration/constants/test-person-ids.constants';
|
||||
import { TEST_PRIMARY_LINK_URL } from 'test/integration/constants/test-primary-link-url.constant';
|
||||
import { makeRestAPIRequest } from 'test/integration/rest/utils/make-rest-api-request.util';
|
||||
import { deleteAllRecords } from 'test/integration/utils/delete-all-records';
|
||||
import { generateRecordName } from 'test/integration/utils/generate-record-name';
|
||||
import { TEST_COMPANY_1_ID } from 'test/integration/constants/test-company-ids.constants';
|
||||
import { TEST_PRIMARY_LINK_URL } from 'test/integration/constants/test-primary-link-url.constant';
|
||||
|
||||
describe('Core REST API Create One endpoint', () => {
|
||||
beforeEach(async () => {
|
||||
@ -108,6 +108,7 @@ describe('Core REST API Create One endpoint', () => {
|
||||
|
||||
expect(createdPerson.company.people).toBeDefined();
|
||||
const depth2Person = createdPerson.company.people.find(
|
||||
// @ts-expect-error legacy noImplicitAny
|
||||
(p) => p.id === createdPerson.id,
|
||||
);
|
||||
|
||||
|
||||
@ -268,9 +268,11 @@ describe('Core REST API Find Duplicates endpoint', () => {
|
||||
expect(personDuplicated2.company.people).toBeDefined();
|
||||
|
||||
const depth2Person1 = personDuplicated1.company.people.find(
|
||||
// @ts-expect-error legacy noImplicitAny
|
||||
(p) => p.id === personDuplicated1.id,
|
||||
);
|
||||
const depth2Person2 = personDuplicated2.company.people.find(
|
||||
// @ts-expect-error legacy noImplicitAny
|
||||
(p) => p.id === personDuplicated2.id,
|
||||
);
|
||||
|
||||
|
||||
@ -70,6 +70,7 @@ describe('Core REST API Find Many endpoint', () => {
|
||||
|
||||
// Check that our test people are included in the results
|
||||
for (const personId of testPersonIds) {
|
||||
// @ts-expect-error legacy noImplicitAny
|
||||
const person = people.find((p) => p.id === personId);
|
||||
|
||||
expect(person).toBeDefined();
|
||||
@ -308,6 +309,7 @@ describe('Core REST API Find Many endpoint', () => {
|
||||
|
||||
expect(person.company.people).toBeDefined();
|
||||
|
||||
// @ts-expect-error legacy noImplicitAny
|
||||
const depth2Person = person.company.people.find((p) => p.id === person.id);
|
||||
|
||||
expect(depth2Person).toBeDefined();
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import { TEST_COMPANY_1_ID } from 'test/integration/constants/test-company-ids.constants';
|
||||
import {
|
||||
NOT_EXISTING_TEST_PERSON_ID,
|
||||
TEST_PERSON_1_ID,
|
||||
} from 'test/integration/constants/test-person-ids.constants';
|
||||
import { TEST_COMPANY_1_ID } from 'test/integration/constants/test-company-ids.constants';
|
||||
import { makeRestAPIRequest } from 'test/integration/rest/utils/make-rest-api-request.util';
|
||||
import { generateRecordName } from 'test/integration/utils/generate-record-name';
|
||||
import { deleteAllRecords } from 'test/integration/utils/delete-all-records';
|
||||
import { TEST_PRIMARY_LINK_URL } from 'test/integration/constants/test-primary-link-url.constant';
|
||||
import { makeRestAPIRequest } from 'test/integration/rest/utils/make-rest-api-request.util';
|
||||
import { deleteAllRecords } from 'test/integration/utils/delete-all-records';
|
||||
import { generateRecordName } from 'test/integration/utils/generate-record-name';
|
||||
|
||||
describe('Core REST API Find One endpoint', () => {
|
||||
let personCity: string;
|
||||
@ -124,6 +124,7 @@ describe('Core REST API Find One endpoint', () => {
|
||||
expect(person.company.people).toBeDefined();
|
||||
|
||||
const depth2Person = person.company.people.find(
|
||||
// @ts-expect-error legacy noImplicitAny
|
||||
(p) => p.id === person.id,
|
||||
);
|
||||
|
||||
|
||||
@ -115,6 +115,7 @@ describe('Core REST API Update One endpoint', () => {
|
||||
expect(updatedPerson.company.people).toBeDefined();
|
||||
|
||||
const depth2Person = updatedPerson.company.people.find(
|
||||
// @ts-expect-error legacy noImplicitAny
|
||||
(p) => p.id === updatedPerson.id,
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user