Skip to content

Commit

Permalink
fix test TS errors
Browse files Browse the repository at this point in the history
  • Loading branch information
onursumer committed Oct 20, 2021
1 parent 304d376 commit 6211c30
Show file tree
Hide file tree
Showing 183 changed files with 221 additions and 211 deletions.
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"@types/jstree": "^3.3.35",
"@types/lodash": "4.14.104",
"@types/lolex": "1.5.31",
"@types/mocha": "2.2.41",
"@types/mocha": "9.0.0",
"@types/numeral": "0.0.22",
"@types/pako": "1.0.1",
"@types/pdfobject": "2.0.5",
Expand Down Expand Up @@ -341,6 +341,7 @@
"identity-obj-proxy": "^3.0.0",
"jasmine-core": "^3.9.0",
"jest": "^27.2.1",
"jest-canvas-mock": "^2.3.1",
"jest-environment-jsdom": "^27.2.0",
"json": "^9.0.6",
"mocha": "^9.1.1",
Expand All @@ -356,9 +357,9 @@
"yargs": "^6.6.0"
},
"jest": {
"preset": "ts-jest",
"preset": "ts-jest/presets/js-with-ts",
"moduleNameMapper": {
"\\.(css|sass|scss)$": "identity-obj-proxy",
"\\.(css|sass|scss|png|svg)$": "identity-obj-proxy",
"^containers(.*)$": "<rootDir>/src/containers$1",
"^components(.*)$": "<rootDir>/src/components$1",
"^config(.*)$": "<rootDir>/src/config$1",
Expand All @@ -374,7 +375,8 @@
}
},
"setupFiles": [
"<rootDir>/src/setupTests.ts"
"<rootDir>/src/setupTests.ts",
"jest-canvas-mock"
],
"testMatch": [
"<rootDir>/src/**/*.spec.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/AppStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
remoteData,
} from 'cbioportal-frontend-commons';
import { getLoadConfig, getServerConfig } from './config/config';
import * as _ from 'lodash';
import _ from 'lodash';
import internalClient from 'shared/api/cbioportalInternalClientInstance';
import { sendSentryMessage } from './shared/lib/tracking';

Expand Down
2 changes: 1 addition & 1 deletion src/appBootstrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from './config/config';

import './shared/lib/ajaxQuiet';
import * as _ from 'lodash';
import _ from 'lodash';
import $ from 'jquery';
import * as superagent from 'superagent';
import { buildCBioPortalPageUrl } from './shared/api/urls';
Expand Down
2 changes: 1 addition & 1 deletion src/appShell/App/PortalHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as _ from 'lodash';
import _ from 'lodash';
import { Link, NavLink } from 'react-router-dom';
import { If, Then, Else } from 'react-if';
import { AppStore } from '../../AppStore';
Expand Down
2 changes: 1 addition & 1 deletion src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
ILoadConfig,
IServerConfig,
} from './IAppConfig';
import * as _ from 'lodash';
import _ from 'lodash';
import ServerConfigDefaults from './serverConfigDefaults';
import memoize from 'memoize-weak-decorator';

Expand Down
2 changes: 1 addition & 1 deletion src/pages/groupComparison/ClinicalDataEnrichmentsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as _ from 'lodash';
import _ from 'lodash';
import { observer } from 'mobx-react';
import autobind from 'autobind-decorator';
import LazyMobXTable from 'shared/components/lazyMobXTable/LazyMobXTable';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/groupComparison/GenericAssayEnrichments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { MakeMobxView } from '../../shared/components/MobxView';
import Loader from '../../shared/components/loadingIndicator/LoadingIndicator';
import ErrorMessage from '../../shared/components/ErrorMessage';
import { MakeEnrichmentsTabUI } from './GroupComparisonUtils';
import * as _ from 'lodash';
import _ from 'lodash';
import ComparisonStore from '../../shared/lib/comparison/ComparisonStore';
import GenericAssayEnrichmentsContainer from 'pages/resultsView/enrichments/GenericAssayEnrichmentsContainer';
import EnrichmentsDataSetDropdown from 'pages/resultsView/enrichments/EnrichmentsDataSetDropdown';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/groupComparison/MRNAEnrichments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import LoadingIndicator from '../../shared/components/loadingIndicator/LoadingIn
import ErrorMessage from '../../shared/components/ErrorMessage';
import ExpressionEnrichmentContainer from '../resultsView/enrichments/ExpressionEnrichmentsContainer';
import { MakeEnrichmentsTabUI } from './GroupComparisonUtils';
import * as _ from 'lodash';
import _ from 'lodash';
import ComparisonStore from '../../shared/lib/comparison/ComparisonStore';
import { EnrichmentType } from 'pages/resultsView/enrichments/EnrichmentsUtil';

Expand Down
2 changes: 1 addition & 1 deletion src/pages/groupComparison/MethylationEnrichments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ExpressionEnrichmentContainer from '../resultsView/enrichments/Expression
import Loader from '../../shared/components/loadingIndicator/LoadingIndicator';
import ErrorMessage from '../../shared/components/ErrorMessage';
import { MakeEnrichmentsTabUI } from './GroupComparisonUtils';
import * as _ from 'lodash';
import _ from 'lodash';
import ComparisonStore from '../../shared/lib/comparison/ComparisonStore';
import { EnrichmentType } from 'pages/resultsView/enrichments/EnrichmentsUtil';

Expand Down
2 changes: 1 addition & 1 deletion src/pages/groupComparison/ProteinEnrichments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ExpressionEnrichmentContainer from '../resultsView/enrichments/Expression
import Loader from '../../shared/components/loadingIndicator/LoadingIndicator';
import ErrorMessage from '../../shared/components/ErrorMessage';
import { MakeEnrichmentsTabUI } from './GroupComparisonUtils';
import * as _ from 'lodash';
import _ from 'lodash';
import ComparisonStore from '../../shared/lib/comparison/ComparisonStore';
import { EnrichmentType } from 'pages/resultsView/enrichments/EnrichmentsUtil';

Expand Down
6 changes: 1 addition & 5 deletions src/pages/groupComparison/UpSet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
Bar,
} from 'victory';
import { computed, makeObservable, observable } from 'mobx';
import * as _ from 'lodash';
import _ from 'lodash';
import {
CBIOPORTAL_VICTORY_THEME,
axisTickLabelStyles,
Expand All @@ -34,7 +34,6 @@ import * as ReactDOM from 'react-dom';
import { Popover } from 'react-bootstrap';
import classnames from 'classnames';
import styles from '../resultsView/survival/styles.module.scss';
import Timer = NodeJS.Timer;
import WindowStore from '../../shared/components/window/WindowStore';
import invertIncreasingFunction from '../../shared/lib/invertIncreasingFunction';
import GroupTickLabelComponent from './labelComponents/GroupTickLabelComponent';
Expand Down Expand Up @@ -86,9 +85,6 @@ export default class UpSet extends React.Component<IUpSetProps, {}> {
}

private makeMouseEvents() {
let disappearTimeout: Timer | null = null;
const disappearDelayMs = 250;

return [
{
target: 'data',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/patientView/PatientViewPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as _ from 'lodash';
import _ from 'lodash';
import GenomicOverview from './genomicOverview/GenomicOverview';
import {
CancerStudy,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/patientView/SampleManager.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as _ from 'lodash';
import _ from 'lodash';
import SampleInline from './patientHeader/SampleInline';
import {
ClinicalData,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as _ from 'lodash';
import _ from 'lodash';
import convertSamplesData, {
IConvertedSamplesData,
} from './lib/convertSamplesData';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as _ from 'lodash';
import _ from 'lodash';
import {
CBioPortalAPIInternal,
ClinicalData,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { observable, action, makeObservable } from 'mobx';
import Immutable from 'seamless-immutable';
import * as _ from 'lodash';
import _ from 'lodash';
import accumulatingDebounce from '../../../shared/lib/accumulatingDebounce';

export type CacheData<T> =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { observer } from 'mobx-react';
import { computed, makeObservable, observable } from 'mobx';
import * as _ from 'lodash';
import _ from 'lodash';
import LazyMobXTable from 'shared/components/lazyMobXTable/LazyMobXTable';
import {
CancerStudy,
Expand Down Expand Up @@ -31,8 +31,6 @@ import {
RemoteData,
} from 'cbioportal-utils';
import { CancerGene } from 'oncokb-ts-api-client';
import { getPercentage } from 'shared/lib/FormatUtils';
import Timeout = NodeJS.Timeout;

class CNATableComponent extends LazyMobXTable<DiscreteCopyNumberData[]> {}

Expand Down Expand Up @@ -76,7 +74,7 @@ export default class CopyNumberTableWrapper extends React.Component<
{}
> {
@observable oncokbWidth = 22;
private oncokbInterval: Timeout;
private oncokbInterval: any;

constructor(props: ICopyNumberTableWrapperProps) {
super(props);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as _ from 'lodash';
import _ from 'lodash';
import {
buildCivicEntry,
calculateOncoKbAvailableDataType,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/patientView/genomicOverview/GenomicOverview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as _ from 'lodash';
import _ from 'lodash';
import { If } from 'react-if';
import Tracks from './Tracks';
import { ThumbnailExpandVAFPlot } from '../vafPlot/ThumbnailExpandVAFPlot';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/patientView/genomicOverview/Tracks.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import * as _ from 'lodash';
import _ from 'lodash';
import * as tracksHelper from './tracksHelper';
import {
ClinicalDataBySampleId,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/patientView/genomicOverview/tracksHelper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Raphael from 'webpack-raphael';
import $ from 'jquery';
import * as _ from 'lodash';
import _ from 'lodash';
import 'qtip2';
import 'qtip2/dist/jquery.qtip.css';
import { Mutation } from 'cbioportal-ts-api-client';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as _ from 'lodash';
import _ from 'lodash';
import { DefaultTooltip } from 'cbioportal-frontend-commons';
import 'rc-tooltip/assets/bootstrap_white.css';
import { Mutation } from 'cbioportal-ts-api-client';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import styles from './styles.module.scss';
import PatientViewMutationsDataStore from '../PatientViewMutationsDataStore';
import { Mutation } from 'cbioportal-ts-api-client';
import ReactDOM from 'react-dom';
import Timeout = NodeJS.Timeout;
import PatientViewUrlWrapper from '../../PatientViewUrlWrapper';
import { getVariantAlleleFrequency } from 'shared/lib/MutationUtils';

Expand Down Expand Up @@ -116,7 +115,7 @@ export default class MutationOncoprint extends React.Component<
@observable private horzZoomSliderState = 100;
@observable minZoom = 0;

private minZoomUpdater: Timeout;
private minZoomUpdater: any;

constructor(props: IMutationOncoprintProps) {
super(props);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/patientView/pathologyReport/PathologyReport.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { PathologyReportPDF } from '../clinicalInformation/PatientViewPageStore';
import { If, Then, Else } from 'react-if';
import * as _ from 'lodash';
import _ from 'lodash';
import IFrameLoader from '../../../shared/components/iframeLoader/IFrameLoader';
import { observer } from 'mobx-react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import TumorColumnFormatter from '../mutation/column/TumorColumnFormatter';
import HeaderIconMenu from '../mutation/HeaderIconMenu';
import GeneFilterMenu from '../mutation/GeneFilterMenu';
import PanelColumnFormatter from 'shared/components/mutationTable/column/PanelColumnFormatter';
import * as _ from 'lodash';
import _ from 'lodash';
import { MakeMobxView } from 'shared/components/MobxView';
import LoadingIndicator from 'shared/components/loadingIndicator/LoadingIndicator';
import ErrorMessage from 'shared/components/ErrorMessage';
Expand All @@ -19,7 +19,6 @@ import { getServerConfig } from 'config/config';
import { ServerConfigHelpers } from 'config/config';
import ChromosomeColumnFormatter from 'shared/components/mutationTable/column/ChromosomeColumnFormatter';
import { remoteData } from 'cbioportal-frontend-commons';
import Timeout = NodeJS.Timeout;

export interface IPatientViewStructuralVariantTableProps {
store: PatientViewPageStore;
Expand All @@ -38,7 +37,7 @@ export default class PatientViewStructuralVariantTable extends React.Component<
{}
> {
@observable oncokbWidth = 22;
private oncokbInterval: Timeout;
private oncokbInterval: any;

constructor(props: IPatientViewStructuralVariantTableProps) {
super(props);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as _ from 'lodash';
import _ from 'lodash';
import {
civicSortValue,
DEFAULT_ANNOTATION_DATA,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/patientView/timeline/Timeline.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as _ from 'lodash';
import _ from 'lodash';
import $ from 'jquery';
import 'jquery-migrate';
require('datatables.net');
Expand Down
2 changes: 1 addition & 1 deletion src/pages/patientView/timeline/legacy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import $ from 'jquery';
import * as _ from 'lodash';
import _ from 'lodash';
import * as d3 from 'd3';

import clinicalTimelineExports from './timeline-lib';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/patientView/trialMatch/TrialMatchFeedback.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as _ from 'lodash';
import _ from 'lodash';
import { Modal } from 'react-bootstrap';
import { ISelectedTrialFeedbackFormData } from './TrialMatchTable';

Expand Down
2 changes: 1 addition & 1 deletion src/pages/patientView/trialMatch/TrialMatchTable.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { If, Then, Else } from 'react-if';
import { observer } from 'mobx-react';
import * as _ from 'lodash';
import _ from 'lodash';
import {
IClinicalGroupMatch,
IGenomicGroupMatch,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert } from 'chai';
import * as _ from 'lodash';
import _ from 'lodash';
import {
getMatchPriority,
excludeControlArms,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/patientView/trialMatch/TrialMatchTableUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
IDrug,
IGenomicMatchType,
} from '../../../shared/model/MatchMiner';
import * as _ from 'lodash';
import _ from 'lodash';

export function groupTrialMatchesById(
trials: ITrial[],
Expand Down
2 changes: 1 addition & 1 deletion src/pages/resultsView/ResultsViewPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as _ from 'lodash';
import _ from 'lodash';
import $ from 'jquery';
import URL from 'url';
import { inject, observer } from 'mobx-react';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/resultsView/ResultsViewPageHelpers.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as _ from 'lodash';
import _ from 'lodash';

import { SamplesSpecificationElement } from './ResultsViewPageStore';
import ResultsViewURLWrapper, {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/resultsView/ResultsViewPageStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ import {
import { fetchHotspotsData } from 'shared/lib/CancerHotspotsUtils';
import ResultsViewMutationMapperStore from './mutation/ResultsViewMutationMapperStore';
import { getServerConfig } from 'config/config';
import * as _ from 'lodash';
import _ from 'lodash';
import { toSampleUuid } from '../../shared/lib/UuidUtils';
import MutationDataCache from '../../shared/cache/MutationDataCache';
import AccessorsForOqlFilter, {
Expand Down
3 changes: 2 additions & 1 deletion src/pages/resultsView/ResultsViewPageStoreUtils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import {
} from '../../shared/lib/oql/oqlfilter';
import { observable } from 'mobx';
import { IndicatorQueryResp } from 'oncokb-ts-api-client';
import * as _ from 'lodash';
import _ from 'lodash';
import sinon from 'sinon';
import sessionServiceClient from 'shared/api//sessionServiceInstance';
import client from 'shared/api/cbioportalClientInstance';
Expand All @@ -54,6 +54,7 @@ import {
VirtualStudy,
VirtualStudyData,
} from 'shared/api/session-service/sessionServiceModels';
import $ from 'jquery';

describe('ResultsViewPageStoreUtils', () => {
describe('computeCustomDriverAnnotationReport', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/resultsView/bookmark/BookmarkModal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as _ from 'lodash';
import _ from 'lodash';
import { observer } from 'mobx-react';
import { Modal } from 'react-bootstrap';
import { makeObservable, observable } from 'mobx';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/resultsView/cancerSummary/CancerSummaryChart.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as _ from 'lodash';
import _ from 'lodash';
import {
VictoryChart,
VictoryLegend,
Expand Down
Loading

0 comments on commit 6211c30

Please sign in to comment.