Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic UI Testing Library #1

Merged
merged 5 commits into from Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
80 changes: 80 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,80 @@
module.exports = {
env: {
node: true,
es6: true,
mocha: true,
},
extends: [
'airbnb-base',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
project: './tsconfig.json',
},
rules: {
'no-plusplus': [2, {allowForLoopAfterthoughts: true}],
'func-names': 'off',
'no-await-in-loop': 'off',
'class-methods-use-this': 'off',
'max-len': [2, {code: 120}],
'no-underscore-dangle': 'off',
'no-shadow': 'off',
indent: ['error', 2, {SwitchCase: 1}],
'function-paren-newline': ['off', 'never'],
'object-curly-spacing': ['error', 'never'],
'padding-line-between-statements': [
'error',
{
blankLine: 'always',
prev: ['for', 'switch', 'var', 'let', 'const'],
next: 'return',
},
{
blankLine: 'always',
prev: ['for', 'switch'],
next: ['var', 'let', 'const'],
},
{
blankLine: 'always',
prev: ['var', 'let', 'const'],
next: ['switch', 'for', 'if'],
},
],
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'no-console': process.env.NODE_ENV === 'production' ? 2 : 0,
'import/no-unresolved': 0,
'import/extensions': ['off', 'never'],
'no-use-before-define': 0,
// Remove after Typescript Migration
'import/no-import-module-exports': 0,
},
overrides: [
{
files: ['*.ts'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'deprecation'],
extends: ['plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended'],
rules: {
'spaced-comment': 0,
'@typescript-eslint/no-extra-semi': 0,
'max-len': ['error', {ignoreComments: true, code: 130}],
'class-methods-use-this': 0,
'no-alert': 0,
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-this-alias': 0,
'@typescript-eslint/no-inferrable-types': 0,
'@typescript-eslint/explicit-module-boundary-types': ['error', {allowArgumentsExplicitlyTypedAsAny: true}],
'func-names': 0,
'no-new': 0,
'deprecation/deprecation': 'error',
},
},
],
};
58 changes: 58 additions & 0 deletions .github/workflows/lint.yml
@@ -0,0 +1,58 @@
name: Lint

on:
pull_request:

env:
NODE_VERSION: '16'

jobs:
lint:
runs-on: ubuntu-latest
name: ESLint

steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Cache Playwright browsers
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright/
key: ${{ runner.os }}-browsers

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install dependencies in UI tests directory
run: npm ci

- name: Check eslint errors
run: npm run lint

tscheck:
runs-on: ubuntu-latest
name: TypeScript Check

steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Cache Playwright browsers
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright/
key: ${{ runner.os }}-browsers

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install dependencies in UI tests directory
run: npm ci

- name: Check TypeScript errors
run: npx tsc --strict
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,26 @@
name: Release package
on:
release:
types: [created]
jobs:
release:
runs-on: ubuntu-latest
steps:
# Checkout project repository
- name: Checkout
uses: actions/checkout@v2

# Setup .npmrc file to publish to npm
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

- name: Publish version
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
/node_modules/*