-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(trustchain): simplify test folders
- Loading branch information
Showing
48 changed files
with
142 additions
and
187 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
### Run end 2 end tests and generate missing unit tests | ||
### Run end 2 end tests and generate missing integration tests | ||
|
||
the e2e script will run all end 2 end tests and record the APDUs, network calls and crypto randomness in order to replay them deterministically in integration tests. | ||
|
||
Just run the tests that miss snapshot mocks. | ||
|
||
``` | ||
pnpm trustchain e2e | ||
``` | ||
|
||
This script will both run all end 2 end tests, and when not created yet, will bootstrap unit tests related to them by recording all APDUs, network calls and crypto randomness in order to play them deterministically in unit tests. | ||
Run all the end2end tests regardless if there are snapshot generated. | ||
|
||
``` | ||
RUN_EVEN_IF_SNAPSHOT_EXISTS=1 pnpm trustchain e2e | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
import path from "path"; | ||
import fs from "fs"; | ||
import { replayTrustchainSdkTests } from "../../../tests/test-helpers/replayTrustchainSdkTests"; | ||
|
||
const mockFolder = path.join(__dirname, "../../../mocks/scenarios"); | ||
const scenarioFolder = path.join(__dirname, "../../../tests/scenarios"); | ||
|
||
fs.readdirSync(mockFolder).forEach(file => { | ||
if (!file.endsWith(".json")) return; | ||
|
||
const slug = file.slice(0, -5); | ||
const json = require(path.join(mockFolder, file)); | ||
const mod = require(path.join(scenarioFolder, slug + ".ts")); | ||
|
||
test(slug, async () => { | ||
const scenario = mod.scenario; | ||
await replayTrustchainSdkTests(json, scenario); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
libs/trustchain/src/__tests__/sdk/getOrCreateTransactionCases.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
libs/trustchain/src/__tests__/sdk/randomMemberTryToDestroy.ts
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
libs/trustchain/src/__tests__/sdk/removeMemberWithTheWrongSeed.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
libs/trustchain/src/__tests__/sdk/removingAMemberCreatesAnInteraction.ts
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
libs/trustchain/src/__tests__/sdk/removingYourselfIsForbidden.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
7 changes: 3 additions & 4 deletions
7
...rustchain/src/test-scenarios/_template.ts → libs/trustchain/tests/scenarios/_template.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 3 additions & 5 deletions
8
...test-scenarios/create2trustchainInARow.ts → ...ests/scenarios/create2trustchainInARow.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 5 additions & 8 deletions
13
.../test-scenarios/member3implicitlyAdded.ts → ...tests/scenarios/member3implicitlyAdded.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 3 additions & 6 deletions
9
.../src/test-scenarios/membersManySelfAdd.ts → ...ain/tests/scenarios/membersManySelfAdd.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 5 additions & 8 deletions
13
...est-scenarios/randomMemberTryToDestroy.ts → ...sts/scenarios/randomMemberTryToDestroy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
...scenarios/removeMemberWithTheWrongSeed.ts → ...scenarios/removeMemberWithTheWrongSeed.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 5 additions & 8 deletions
13
...rc/test-scenarios/removedMemberEjected.ts → ...n/tests/scenarios/removedMemberEjected.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 4 additions & 7 deletions
11
...os/removingAMemberCreatesAnInteraction.ts → ...os/removingAMemberCreatesAnInteraction.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.