-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
- Loading branch information
There are no files selected for viewing
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 | ||
``` |
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.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.