added packages and basic setup

This commit is contained in:
JesmoDev
2022-05-24 16:14:15 +02:00
parent ab86298695
commit 5655c97f6e
4 changed files with 1903 additions and 1 deletions

View File

@@ -13,6 +13,9 @@ dist-ssr
types
*.local
## testing
/coverage/
# Editor directories and files
.vscode/*
!.vscode/extensions.json

File diff suppressed because it is too large Load Diff

View File

@@ -19,7 +19,8 @@
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview --open",
"test": "echo 'TODO: Implement test'",
"test": "web-test-runner --coverage",
"test:watch": "web-test-runner --watch",
"lint": "eslint . --ext .ts --cache",
"lint:fix": "npm run lint -- --fix",
"format": "prettier 'src/**/*.ts'",
@@ -42,6 +43,9 @@
"@types/mocha": "^9.1.1",
"@typescript-eslint/eslint-plugin": "^5.24.0",
"@typescript-eslint/parser": "^5.24.0",
"@web/dev-server-esbuild": "^0.3.0",
"@web/test-runner": "^0.13.28",
"@web/test-runner-playwright": "^0.8.8",
"eslint": "^8.15.0",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^2.7.1",

View File

@@ -0,0 +1,19 @@
import { esbuildPlugin } from '@web/dev-server-esbuild';
import { playwrightLauncher } from '@web/test-runner-playwright';
export default {
nodeResolve: true,
files: 'src/**/*.test.ts',
plugins: [esbuildPlugin({ ts: true, target: 'auto' })],
browsers: [
playwrightLauncher({ product: 'chromium' }),
playwrightLauncher({ product: 'firefox' }),
playwrightLauncher({ product: 'webkit' }),
],
testRunnerHtml: (testFramework) =>
`<html>
<body>
<script type="module" src="${testFramework}"></script>
</body>
</html>`,
};