Skip to content

Commit

Permalink
Move abortTest to promote its more general usage #3239
Browse files Browse the repository at this point in the history
  • Loading branch information
giorgiosironi committed May 15, 2024
1 parent 5a85f6b commit 7672e50
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 11 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/framework/create-command-helpers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as TE from 'fp-ts/TaskEither';
import { pipe } from 'fp-ts/function';
import { abortTest } from './abort-test';
import { ReadAndWriteSides } from './create-read-and-write-sides';
import { ArticleId } from '../../src/types/article-id';
import { CommandHandler, GenericCommand } from '../../src/types/command-handler';
Expand All @@ -16,6 +15,7 @@ import {
UpdateEvaluationCommand,
} from '../../src/write-side/commands';
import { CreateListCommand } from '../../src/write-side/commands/create-list';
import { abortTest } from '../abort-test';

export type CommandHelpers = {
addArticleToList: (articleId: ArticleId, listId: ListId) => Promise<unknown>,
Expand Down
2 changes: 1 addition & 1 deletion test/framework/create-test-framework.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { AbortTest, abortTest } from './abort-test';
import { CommandHelpers, createCommandHelpers } from './create-command-helpers';
import { createReadAndWriteSides, ReadAndWriteSides } from './create-read-and-write-sides';
import { createHappyPathThirdPartyAdapters, HappyPathThirdPartyAdapters } from './happy-path-third-party-adapters';
import { Queries } from '../../src/read-models';
import { Logger } from '../../src/shared-ports';
import { AbortTest, abortTest } from '../abort-test';
import { dummyLogger } from '../dummy-logger';

export type TestFramework = ReadAndWriteSides & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { List } from '../../../../../src/read-models/lists';
import { constructViewModel } from '../../../../../src/read-side/html-pages/lists-page/construct-view-model/construct-view-model';
import { ViewModel } from '../../../../../src/read-side/html-pages/lists-page/view-model';
import * as LOID from '../../../../../src/types/list-owner-id';
import { abortTest } from '../../../../abort-test';
import { TestFramework, createTestFramework } from '../../../../framework';
import { abortTest } from '../../../../framework/abort-test';
import { arbitraryArticleId } from '../../../../types/article-id.helper';
import { arbitraryUserId } from '../../../../types/user-id.helper';
import { arbitraryCreateListCommand } from '../../../../write-side/commands/create-list-command.helper';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { ArticleId } from '../../../../../src/types/article-id';
import * as DE from '../../../../../src/types/data-error';
import * as LOID from '../../../../../src/types/list-owner-id';
import { CreateListCommand, CreateUserAccountCommand } from '../../../../../src/write-side/commands';
import { abortTest } from '../../../../abort-test';
import { createTestFramework, TestFramework } from '../../../../framework';
import { abortTest } from '../../../../framework/abort-test';
import { shouldNotBeCalled } from '../../../../should-not-be-called';
import { arbitraryExpressionDoi } from '../../../../types/expression-doi.helper';
import { arbitraryCreateListCommand } from '../../../../write-side/commands/create-list-command.helper';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as E from 'fp-ts/Either';
import { identity, pipe } from 'fp-ts/function';
import { constructEvent } from '../../../../../src/domain-events';
import { identifyFeedItems } from '../../../../../src/read-side/html-pages/sciety-feed-page/construct-view-model/identify-feed-items';
import { abortTest } from '../../../../framework/abort-test';
import { abortTest } from '../../../../abort-test';
import { shouldNotBeCalled } from '../../../../should-not-be-called';
import { arbitraryArticleId } from '../../../../types/article-id.helper';
import { arbitraryListId } from '../../../../types/list-id.helper';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as RA from 'fp-ts/ReadonlyArray';
import { pipe } from 'fp-ts/function';
import { PageOfItems, paginate } from '../../../../../src/read-side/html-pages/shared-components/pagination/paginate';
import * as DE from '../../../../../src/types/data-error';
import { abortTest } from '../../../../framework/abort-test';
import { abortTest } from '../../../../abort-test';
import { shouldNotBeCalled } from '../../../../should-not-be-called';

const generateItems = (eventCount: number): ReadonlyArray<number> => pipe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import * as DE from '../../../../../src/types/data-error';
import { EvaluationLocator } from '../../../../../src/types/evaluation-locator';
import * as GID from '../../../../../src/types/group-id';
import { RecordEvaluationPublicationCommand } from '../../../../../src/write-side/commands/record-evaluation-publication';
import { abortTest } from '../../../../abort-test';
import { TestFramework, createTestFramework } from '../../../../framework';
import { abortTest } from '../../../../framework/abort-test';
import { shouldNotBeCalled } from '../../../../should-not-be-called';
import { arbitraryArticleId } from '../../../../types/article-id.helper';
import { arbitraryNcrcId } from '../../../../types/evaluation-locator.helper';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import * as E from 'fp-ts/Either';
import { pipe } from 'fp-ts/function';
import { deriveFullTextsOfEvaluations } from '../../../../src/third-parties/fetch-evaluation-digest/access-microbiology/derive-full-texts-of-evaluations';
import { SanitisedHtmlFragment } from '../../../../src/types/sanitised-html-fragment';
import { abortTest } from '../../../abort-test';
import { dummyLogger } from '../../../dummy-logger';
import { abortTest } from '../../../framework/abort-test';
import { arbitraryWord } from '../../../helpers';

describe('derive-full-texts-of-evaluations', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { pipe } from 'fp-ts/function';
import { fetchAccessMicrobiologyEvaluationDigest } from '../../../../src/third-parties/fetch-evaluation-digest/access-microbiology/fetch-access-microbiology-evaluation-digest';
import { QueryExternalService } from '../../../../src/third-parties/query-external-service';
import { SanitisedHtmlFragment } from '../../../../src/types/sanitised-html-fragment';
import { abortTest } from '../../../abort-test';
import { dummyLogger } from '../../../dummy-logger';
import { abortTest } from '../../../framework/abort-test';
import { arbitraryString } from '../../../helpers';

describe('fetch-access-microbiology-evaluation-digest', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/types/user-id.helper.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as E from 'fp-ts/Either';
import { pipe } from 'fp-ts/function';
import { UserId, userIdCodec } from '../../src/types/user-id';
import { abortTest } from '../framework/abort-test';
import { abortTest } from '../abort-test';
import { arbitraryNumber, arbitraryWord } from '../helpers';

const prefixes = ['auth0|', 'twitter|', ''];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as E from 'fp-ts/Either';
import { pipe } from 'fp-ts/function';
import { formatValidationErrors } from 'io-ts-reporters';
import { UpdateUserDetailsCommand, updateUserDetailsCommandCodec } from '../../../src/write-side/commands';
import { abortTest } from '../../framework/abort-test';
import { abortTest } from '../../abort-test';

export const constructUpdateUserDetailsCommand = (input: unknown): UpdateUserDetailsCommand => pipe(
input,
Expand Down

0 comments on commit 7672e50

Please sign in to comment.