From 81cd1e0111dcef3e1876cb710906a6d36ccdc33c Mon Sep 17 00:00:00 2001 From: Joshua Murithi Date: Fri, 4 Oct 2024 22:03:32 +0300 Subject: [PATCH] E2E setup for Openmrs 3.x (#829) --- .idea/.gitignore | 5 + e2e/.env | 6 ++ e2e/.gitignore | 1 + e2e/README.md | 122 +++++++++++++++++++++++ e2e/env.example | 6 ++ e2e/package-lock.json | 119 ++++++++++++++++++++++ e2e/package.json | 20 ++++ e2e/playwright-report/index.html | 68 +++++++++++++ e2e/playwright.config.ts | 32 ++++++ e2e/storageState.json | 15 +++ e2e/test-results/.last-run.json | 4 + e2e/tests/core/global-setup.ts | 33 ++++++ e2e/tests/core/index.ts | 1 + e2e/tests/core/location-selector.ts | 15 +++ e2e/tests/core/test.ts | 25 +++++ e2e/tests/fixtures/api.ts | 26 +++++ e2e/tests/fixtures/index.ts | 1 + e2e/tests/pages/home-page.ts | 9 ++ e2e/tests/pages/index.ts | 1 + e2e/tests/specs/login/login-test.spec.ts | 12 +++ e2e/tsconfig.json | 110 ++++++++++++++++++++ 21 files changed, 631 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 e2e/.env create mode 100644 e2e/.gitignore create mode 100644 e2e/README.md create mode 100644 e2e/env.example create mode 100644 e2e/package-lock.json create mode 100644 e2e/package.json create mode 100644 e2e/playwright-report/index.html create mode 100644 e2e/playwright.config.ts create mode 100644 e2e/storageState.json create mode 100644 e2e/test-results/.last-run.json create mode 100644 e2e/tests/core/global-setup.ts create mode 100644 e2e/tests/core/index.ts create mode 100644 e2e/tests/core/location-selector.ts create mode 100644 e2e/tests/core/test.ts create mode 100644 e2e/tests/fixtures/api.ts create mode 100644 e2e/tests/fixtures/index.ts create mode 100644 e2e/tests/pages/home-page.ts create mode 100644 e2e/tests/pages/index.ts create mode 100644 e2e/tests/specs/login/login-test.spec.ts create mode 100644 e2e/tsconfig.json diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..b58b603f --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/e2e/.env b/e2e/.env new file mode 100644 index 00000000..9f4e05cb --- /dev/null +++ b/e2e/.env @@ -0,0 +1,6 @@ +# This is an example environment file for configuring dynamic values. +E2E_BASE_URL=https://qa.kenyahmis.org/openmrs +E2E_USER_ADMIN_USERNAME=admin +E2E_USER_ADMIN_PASSWORD=Admin123 +E2E_LOGIN_DEFAULT_LOCATION_UUID=44c3efb0-2583-4c80-a79e-1f756a03c0a1 +# The above location UUID is for the "Outpatient Clinic" location in the reference application diff --git a/e2e/.gitignore b/e2e/.gitignore new file mode 100644 index 00000000..2ccbe465 --- /dev/null +++ b/e2e/.gitignore @@ -0,0 +1 @@ +/node_modules/ diff --git a/e2e/README.md b/e2e/README.md new file mode 100644 index 00000000..cce4817e --- /dev/null +++ b/e2e/README.md @@ -0,0 +1,122 @@ +# Kenyaemr E2E Testing Setup + +This project contains end-to-end (e2e) tests using Playwright with TypeScript. It's structured to provide a scalable and maintainable testing framework. + +## Table of Contents + +1. [Prerequisites](#prerequisites) +2. [Installation](#installation) +3. [Project Structure](#project-structure) +4. [Writing Tests](#writing-tests) +5. [Running Tests](#running-tests) +6. [Configuration](#configuration) +7. [Best Practices](#best-practices) +8. [Troubleshooting](#troubleshooting) + +## Prerequisites + +Before you begin, ensure you have the following installed: +- Node.js (v18 or later) +- npm (usually comes with Node.js) + +## Installation + +1. Clone this repository: + ``` + git clone + cd + ``` + +2. Install dependencies: + ``` + npm install + ``` + +3. Install Playwright browsers: + ``` + npx playwright install + ``` +4. Copy env.example by + ``` sh + cat env.example > .env + ``` +## Project Structure + +The project is structured as follows: + +``` +e2e/ +├── tests/ +│ ├── core/ +│ │ └── *.ts +│ ├── fixtures/ +│ │ └── *.ts +│ ├── pages/ +│ │ └── *.ts +│ └── specs/ +│ └── *.ts +├── playwright.config.ts +├── package.json +└── tsconfig.json +``` + +- `core/`: Contains base test setups and utilities. +- `fixtures/`: Holds reusable test fixtures. +- `pages/`: Contains Page Object Models. +- `specs/`: Houses the actual test specifications. + +## Writing Tests + +1. Create a new page object in `tests/pages/` if needed. +2. Write your test in a new or existing spec file in `tests/specs/`. +3. Use the `test` function from `@playwright/test` to define your tests. + +Example: + +```typescript +import { test, expect } from '@playwright/test'; +import { HomePage } from '../pages/homePage'; + +test('Home page title is correct', async ({ page }) => { + const homePage = new HomePage(page); + await homePage.navigate(); + expect(await homePage.getTitle()).toBe('Expected Title'); +}); +``` + +## Running Tests + +To run all tests: + +``` +npm playwright test +``` + +To run a specific test file: + +``` +npx playwright test tests/specs/yourTestFile.ts +``` + +## Configuration + +Playwright is configured in `playwright.config.ts`. You can modify this file to change settings such as browsers, viewport size, and more. + +## Best Practices + +1. Use Page Object Model for better maintainability. +2. Keep tests independent and isolated. +3. Use descriptive test and function names. +4. Utilize fixtures for reusable setup and teardown. +5. Keep sensitive data out of your tests (use environment variables). + +## Troubleshooting + +If you encounter issues: + +1. Ensure all dependencies are installed correctly. +2. Check that Playwright browsers are installed. +3. Verify that your `playwright.config.ts` is correctly set up. +4. Look for error messages in the console output. + +For more help, consult the [Playwright documentation](https://playwright.dev/docs/intro). \ No newline at end of file diff --git a/e2e/env.example b/e2e/env.example new file mode 100644 index 00000000..9f4e05cb --- /dev/null +++ b/e2e/env.example @@ -0,0 +1,6 @@ +# This is an example environment file for configuring dynamic values. +E2E_BASE_URL=https://qa.kenyahmis.org/openmrs +E2E_USER_ADMIN_USERNAME=admin +E2E_USER_ADMIN_PASSWORD=Admin123 +E2E_LOGIN_DEFAULT_LOCATION_UUID=44c3efb0-2583-4c80-a79e-1f756a03c0a1 +# The above location UUID is for the "Outpatient Clinic" location in the reference application diff --git a/e2e/package-lock.json b/e2e/package-lock.json new file mode 100644 index 00000000..c1a9b879 --- /dev/null +++ b/e2e/package-lock.json @@ -0,0 +1,119 @@ +{ + "name": "e2e", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "e2e", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "dotenv": "^16.4.5" + }, + "devDependencies": { + "@playwright/test": "^1.47.2", + "@types/node": "^22.7.4", + "typescript": "^5.6.2" + } + }, + "node_modules/@playwright/test": { + "version": "1.47.2", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.47.2.tgz", + "integrity": "sha512-jTXRsoSPONAs8Za9QEQdyjFn+0ZQFjCiIztAIF6bi1HqhBzG9Ma7g1WotyiGqFSBRZjIEqMdT8RUlbk1QVhzCQ==", + "dev": true, + "dependencies": { + "playwright": "1.47.2" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@types/node": { + "version": "22.7.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.4.tgz", + "integrity": "sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg==", + "dev": true, + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/playwright": { + "version": "1.47.2", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.47.2.tgz", + "integrity": "sha512-nx1cLMmQWqmA3UsnjaaokyoUpdVaaDhJhMoxX2qj3McpjnsqFHs516QAKYhqHAgOP+oCFTEOCOAaD1RgD/RQfA==", + "dev": true, + "dependencies": { + "playwright-core": "1.47.2" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.47.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.47.2.tgz", + "integrity": "sha512-3JvMfF+9LJfe16l7AbSmU555PaTl2tPyQsVInqm3id16pdDfvZ8TTZ/pyzmkbDrZTQefyzU7AIHlZqQnxpqHVQ==", + "dev": true, + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/typescript": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", + "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true + } + } +} diff --git a/e2e/package.json b/e2e/package.json new file mode 100644 index 00000000..64aa3009 --- /dev/null +++ b/e2e/package.json @@ -0,0 +1,20 @@ +{ + "name": "e2e", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "description": "", + "devDependencies": { + "@playwright/test": "^1.47.2", + "@types/node": "^22.7.4", + "typescript": "^5.6.2" + }, + "dependencies": { + "dotenv": "^16.4.5" + } +} diff --git a/e2e/playwright-report/index.html b/e2e/playwright-report/index.html new file mode 100644 index 00000000..256fdecf --- /dev/null +++ b/e2e/playwright-report/index.html @@ -0,0 +1,68 @@ + + + + + + + + + Playwright Test Report + + + + +
+ + + \ No newline at end of file diff --git a/e2e/playwright.config.ts b/e2e/playwright.config.ts new file mode 100644 index 00000000..c183da85 --- /dev/null +++ b/e2e/playwright.config.ts @@ -0,0 +1,32 @@ +import { devices, PlaywrightTestConfig } from '@playwright/test'; +import * as dotenv from 'dotenv'; +dotenv.config(); + +// See https://playwright.dev/docs/test-configuration. +const config: PlaywrightTestConfig = { + testDir: 'tests', + timeout: 3 * 60 * 1000, + expect: { + timeout: 40 * 1000, + }, + fullyParallel: true, + forbidOnly: !!process.env.CI, + retries: 0, + reporter: process.env.CI ? [['junit', { outputFile: 'results.xml' }], ['html']] : [['html']], + globalSetup: require.resolve('./tests/core/global-setup'), + use: { + baseURL: `${process.env.E2E_BASE_URL}/spa/`, + storageState: 'storageState.json', + video: 'retain-on-failure', + }, + projects: [ + { + name: 'chromium', + use: { + ...devices['Desktop Chrome'], + }, + }, + ], +}; + +export default config; diff --git a/e2e/storageState.json b/e2e/storageState.json new file mode 100644 index 00000000..26a1dd03 --- /dev/null +++ b/e2e/storageState.json @@ -0,0 +1,15 @@ +{ + "cookies": [ + { + "name": "JSESSIONID", + "value": "EB1804BCC4968A7ECDDDC5F33F5CEBF6", + "domain": "qa.kenyahmis.org", + "path": "/openmrs", + "expires": -1, + "httpOnly": true, + "secure": false, + "sameSite": "Lax" + } + ], + "origins": [] +} \ No newline at end of file diff --git a/e2e/test-results/.last-run.json b/e2e/test-results/.last-run.json new file mode 100644 index 00000000..cbcc1fba --- /dev/null +++ b/e2e/test-results/.last-run.json @@ -0,0 +1,4 @@ +{ + "status": "passed", + "failedTests": [] +} \ No newline at end of file diff --git a/e2e/tests/core/global-setup.ts b/e2e/tests/core/global-setup.ts new file mode 100644 index 00000000..3e682b22 --- /dev/null +++ b/e2e/tests/core/global-setup.ts @@ -0,0 +1,33 @@ + +import { request } from '@playwright/test'; +import * as dotenv from 'dotenv'; + +dotenv.config(); + +/** + * This configuration is to reuse the signed-in state in the tests + * by log in only once using the API and then skip the log in step for all the tests. + * + * https://playwright.dev/docs/auth#reuse-signed-in-state + */ + +async function globalSetup() { + const requestContext = await request.newContext(); + const token = Buffer.from(`${process.env.E2E_USER_ADMIN_USERNAME}:${process.env.E2E_USER_ADMIN_PASSWORD}`).toString( + 'base64', + ); + await requestContext.post(`${process.env.E2E_BASE_URL}/ws/rest/v1/session`, { + data: { + sessionLocation: process.env.E2E_LOGIN_DEFAULT_LOCATION_UUID, + locale: 'en', + }, + headers: { + 'Content-Type': 'application/json', + Authorization: `Basic ${token}`, + }, + }); + await requestContext.storageState({ path: 'storageState.json' }); + await requestContext.dispose(); +} + +export default globalSetup; diff --git a/e2e/tests/core/index.ts b/e2e/tests/core/index.ts new file mode 100644 index 00000000..607718c2 --- /dev/null +++ b/e2e/tests/core/index.ts @@ -0,0 +1 @@ +export * from './test'; diff --git a/e2e/tests/core/location-selector.ts b/e2e/tests/core/location-selector.ts new file mode 100644 index 00000000..d80264aa --- /dev/null +++ b/e2e/tests/core/location-selector.ts @@ -0,0 +1,15 @@ +import { Page } from '@playwright/test'; + +export function addURLChangeListener(page: Page) { + page.on('framenavigated', async (frame) => { + if (frame === page.mainFrame()) { + const currentURL = frame.url(); + + if (currentURL.includes('/login/location')) { + const firstCheckbox = page.locator('input[type="radio"]').first(); + await firstCheckbox.check({ force: true }); + await page.locator('button:has-text("Confirm")').click(); + } + } + }); +} diff --git a/e2e/tests/core/test.ts b/e2e/tests/core/test.ts new file mode 100644 index 00000000..74aa92d9 --- /dev/null +++ b/e2e/tests/core/test.ts @@ -0,0 +1,25 @@ +import { APIRequestContext, Page, test as base } from '@playwright/test'; +import { api } from '../fixtures'; +import { addURLChangeListener } from './location-selector'; + +// This file sets up our custom test harness using the custom fixtures. +// See https://playwright.dev/docs/test-fixtures#creating-a-fixture for details. +// If a spec intends to use one of the custom fixtures, the special `test` function +// exported from this file must be used instead of the default `test` function +// provided by playwright. + +export interface CustomTestFixtures { + loginAsAdmin: Page; +} + +export interface CustomWorkerFixtures { + api: APIRequestContext; +} + +export const test = base.extend({ + api: [api, { scope: 'worker' }], + page: async ({ page }, use) => { + addURLChangeListener(page); + await use(page); + }, +}); diff --git a/e2e/tests/fixtures/api.ts b/e2e/tests/fixtures/api.ts new file mode 100644 index 00000000..6afd8d59 --- /dev/null +++ b/e2e/tests/fixtures/api.ts @@ -0,0 +1,26 @@ +import { APIRequestContext, PlaywrightWorkerArgs, WorkerFixture } from '@playwright/test'; + +/** + * A fixture which initializes an [`APIRequestContext`](https://playwright.dev/docs/api/class-apirequestcontext) + * that is bound to the configured OpenMRS API server. The context is automatically authenticated + * using the configured admin account. + * + * Use the request context like this: + * ```ts + * test('your test', async ({ api }) => { + * const res = await api.get('patient/1234'); + * await expect(res.ok()).toBeTruthy(); + * }); + * ``` + */ +export const api: WorkerFixture = async ({ playwright }, use) => { + const ctx = await playwright.request.newContext({ + baseURL: `${process.env.E2E_BASE_URL}/ws/rest/v1/`, + httpCredentials: { + username: process.env.E2E_USER_ADMIN_USERNAME, + password: process.env.E2E_USER_ADMIN_PASSWORD, + }, + }); + + await use(ctx); +}; diff --git a/e2e/tests/fixtures/index.ts b/e2e/tests/fixtures/index.ts new file mode 100644 index 00000000..b1c13e73 --- /dev/null +++ b/e2e/tests/fixtures/index.ts @@ -0,0 +1 @@ +export * from './api'; diff --git a/e2e/tests/pages/home-page.ts b/e2e/tests/pages/home-page.ts new file mode 100644 index 00000000..dbc83b36 --- /dev/null +++ b/e2e/tests/pages/home-page.ts @@ -0,0 +1,9 @@ +import { Page } from '@playwright/test'; + +export class HomePage { + constructor(readonly page: Page) {} + + async gotoHome() { + await this.page.goto('home'); + } +} diff --git a/e2e/tests/pages/index.ts b/e2e/tests/pages/index.ts new file mode 100644 index 00000000..5778f2f1 --- /dev/null +++ b/e2e/tests/pages/index.ts @@ -0,0 +1 @@ +export * from './home-page'; diff --git a/e2e/tests/specs/login/login-test.spec.ts b/e2e/tests/specs/login/login-test.spec.ts new file mode 100644 index 00000000..ac32fe5d --- /dev/null +++ b/e2e/tests/specs/login/login-test.spec.ts @@ -0,0 +1,12 @@ +import { test } from '../../core'; +import { expect } from '@playwright/test'; +import { HomePage } from '../../pages'; + +test('Login to homepage', async ({ page }) => { + const homePage = new HomePage(page); + + await test.step('When I visit the home page', async () => { + await homePage.gotoHome(); + await expect(page).toHaveURL(`${process.env.E2E_BASE_URL}/spa/home`); + }); +}); diff --git a/e2e/tsconfig.json b/e2e/tsconfig.json new file mode 100644 index 00000000..56a8ab81 --- /dev/null +++ b/e2e/tsconfig.json @@ -0,0 +1,110 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + // "noUncheckedSideEffectImports": true, /* Check side effect imports. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + // "outDir": "./", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + } +}