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
Show hidden characters
{ | |
"files": ["*.ts"], | |
"excludedFiles": ["*.spec.ts"], | |
"parserOptions": { | |
"project": ["tsconfig.json"], | |
"createDefaultProgram": true | |
}, | |
"plugins": ["@cspell"], | |
"rules": { | |
"@cspell/spellchecker": [ |
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
--- | |
$schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json | |
# using this configuration, ESLint checks TypeScript files for spelling errors | |
# the paths are relative to the location of the following directory | |
globRoot: './' | |
# skip excluded files | |
useGitignore: true |
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
import { Injectable } from '@angular/core'; | |
import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http'; | |
import { Observable } from 'rxjs'; | |
/** | |
* See https://angular.io/guide/service-worker-devops#bypassing-the-service-worker for more info. | |
* This interceptor is used to bypass the service worker when making HTTP requests as there are some cases where the service worker might run into issues. | |
* Since we are not using the service worker for caching HTTP requests, we can safely bypass it. | |
* Attention: make sure that this header is explicitly allowed (e.g. by your file storage provider else file fetches might fail due to CORS). | |
*/ |
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
<div #formDropArea="cdkDropList" class="formFieldsDropArea" cdkDropList (cdkDropListDropped)="onDrop($event)"> | |
<div *ngFor="let formField of formFields; let index = index; trackBy: trackByIndex" class="columns" cdkDrag (cdkDragStarted)="onDragStart()"> | |
<div class="column is-narrow"> | |
<i class="fas fa-fw fa-grip-vertical" cdkDragHandle title="Drag to reorder"></i> | |
</div> | |
<div class="column"> | |
<input [ngModel]="formField.title" (ngModelChange)="onFormFieldChange(formField, $event)""> | |
<button (click)="deleteField(index)">Delete</button> | |
</div> | |
</div> |
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
import { GenericContainer, StartedTestContainer } from 'testcontainers'; | |
import { AbstractStartedContainer } from 'testcontainers/dist/modules/abstract-started-container'; | |
import { RandomUuid } from 'testcontainers/dist/uuid'; | |
const POSTGRES_PORT = 5432; | |
export async function createDatabaseContainer() { | |
// reusing the same container for all tests is considerably faster than starting a new one for each test | |
const container = await new PostgreSqlContainer().withReuse().start(); | |
const host = container.getHost(); |
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
// helpful if you use Nx - else you can omit this import | |
import 'tsconfig-paths/register'; | |
import { createDatabaseContainer } from './e2e/testing-setup.helpers'; | |
export default async () => { | |
await createDatabaseContainer(); | |
}; |
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
// helpful if you use Nx - else you can omit this import | |
import 'tsconfig-paths/register'; | |
import { getContainerById } from 'testcontainers/dist/docker/functions/container/get-container'; | |
export default async () => { | |
const containerId = process.env.TEST_POSTGRES_CONTAINER_ID!; | |
const container = await getContainerById(containerId); | |
await container.stop(); | |
// deletion of docker volume after running all tests | |
await container.remove({ v: true })); |
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
/** | |
* @type {import("ts-jest/dist/types").InitialOptionsTsJest} | |
*/ | |
module.exports = { | |
globalSetup: './jest-global-setup.ts', | |
globalTeardown: './jest-global-teardown.ts', | |
globals: { | |
'ts-jest': { | |
tsconfig: '<rootDir>/tsconfig.spec.json', | |
isolatedModules: true |
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
jobs: | |
changes: | |
runs-on: ubuntu-latest | |
name: Check changes | |
outputs: | |
functions: ${{ steps.filter.outputs.functions }} | |
steps: | |
- uses: actions/checkout@v3 | |
name: Checkout project to determine changed files | |
with: |
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
ci_web: | |
name: "Build & Tests & Lint" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout project" | |
uses: actions/checkout@v3 | |
- name: "Use Node.js" | |
uses: actions/setup-node@v3 |
NewerOlder