diff --git a/cmd/e2e/package.json b/cmd/e2e/package.json index f74a87d69c..de9bb067cf 100644 --- a/cmd/e2e/package.json +++ b/cmd/e2e/package.json @@ -6,7 +6,7 @@ }, "scripts": { "generate:prisma": "yarn prisma db pull && yarn prisma generate", - "pretest": "ts-node/esm src/helpers/init.ts", + "pretest": "tsc src/helpers/init.ts", "test:e2e": "env-cmd -e dev cucumber-js --config=src/cucumber.json --tags '@e2e'", "test:failed": "env-cmd -e dev cucumber-js -p rerun --config=src/cucumber.json @rerun.txt" }, diff --git a/cmd/e2e/prisma/seed.ts b/cmd/e2e/prisma/seed.ts index 5bf0f7d100..b7b92646c8 100644 --- a/cmd/e2e/prisma/seed.ts +++ b/cmd/e2e/prisma/seed.ts @@ -65,7 +65,7 @@ export class User { if (this.password == '') { uniquePassword = faker.lorem.word({ length: { min: 5, max: 10 }}) } else { - uniquePassword = this.password + uniquePassword = this.password as string } const now = new Date(); diff --git a/cmd/e2e/src/cucumber.js b/cmd/e2e/src/cucumber.js deleted file mode 100644 index 01d2870647..0000000000 --- a/cmd/e2e/src/cucumber.js +++ /dev/null @@ -1,43 +0,0 @@ -module.exports = { - default: { - formatOptions: { - snippetInterface: "async-await" - }, - paths: [ - "src/tests/features/" - ], - dryRun: false, - require: [ - "src/tests/steps/*.ts", - "src/support/hooks.ts" - ], - requireModule: [ - "ts-node/register" - ], - format: [ - "progress-bar", - "html:test-results/reports/html/cucumber-report.html", - "json:test-results/reports/json/cucumber-report.json", - "rerun:@rerun.txt" - ] - }, - rerun: { - formatOptions: { - snippetInterface: "async-await" - }, - dryRun: false, - require: [ - "src/tests/steps/*.ts", - "src/support/hooks.ts" - ], - requireModule: [ - "ts-node/register" - ], - format: [ - "progress-bar", - "html:test-results/reports/html/cucumber-report.html", - "json:test-results/reports/json/cucumber-report.json", - "rerun:@rerun.txt" - ] - } -} \ No newline at end of file diff --git a/cmd/e2e/src/helpers/hashpassword.ts b/cmd/e2e/src/helpers/hashpassword.ts index 973e66fadc..690a170328 100644 --- a/cmd/e2e/src/helpers/hashpassword.ts +++ b/cmd/e2e/src/helpers/hashpassword.ts @@ -7,7 +7,7 @@ import { hash, argon2id } from 'argon2'; * Returns a string suitable for use as the 'digest' of an auth_secrets record in the postgres db * Matches the same algorithm used by the BHE API when creating or updating auth_secrets */ -const hashPassword = async (password) => { +const hashPassword = async (password: string) => { const hashedPassword = await hash(password, { type: argon2id, timeCost: 3, diff --git a/cmd/e2e/src/support/FixtureManager.ts b/cmd/e2e/src/support/FixtureManager.ts index f6ee668c19..ae75dc5834 100644 --- a/cmd/e2e/src/support/FixtureManager.ts +++ b/cmd/e2e/src/support/FixtureManager.ts @@ -10,10 +10,10 @@ export interface IFixture { } // FixtureManager manages the state of the browser and page for each scenario export default class FixtureManager implements IFixture { - browser: Browser; - context: BrowserContext; + browser!: Browser; + context!: BrowserContext; pageManager: PageManager; - page: Page; + page!: Page; constructor() { this.pageManager = new PageManager(); diff --git a/cmd/e2e/src/support/pageManager.ts b/cmd/e2e/src/support/pageManager.ts index 134dd3c73c..972ddb0c8b 100644 --- a/cmd/e2e/src/support/pageManager.ts +++ b/cmd/e2e/src/support/pageManager.ts @@ -1,7 +1,7 @@ import { BrowserContext, Page } from "@playwright/test"; export default class PageManager { - currentPage: Page; + currentPage!: Page; get Page(): Page { return this.currentPage; diff --git a/cmd/e2e/tsconfig.json b/cmd/e2e/tsconfig.json index d1ec742c9f..4f104d3b1f 100644 --- a/cmd/e2e/tsconfig.json +++ b/cmd/e2e/tsconfig.json @@ -2,10 +2,10 @@ "compilerOptions": { "module": "ESNext", "typeRoots": [ - "./node_modules/@types", "src/helpers/types" ], "moduleResolution": "nodenext", - "resolveJsonModule": true + "strict": true, + "noUncheckedIndexedAccess": true } } diff --git a/yarn.lock b/yarn.lock index 51a86d7175..7fab575940 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5783,7 +5783,6 @@ __metadata: playwright: 1.49.0 prisma: 5.22.0 reflect-metadata: ^0.2.2 - ts-node: ^10.9.2 typescript: 5.6.3 languageName: unknown linkType: soft