Build/Refactor: lint pre-commit hook and reformat repo to spec (#314)

* build/refactor: move lint/prettier packages to project root, install husky, add pre-commit hook

* refactor: reformat files

* build: put full eslintrc back with all rules
This commit is contained in:
Dan Orlando 2023-05-18 11:09:31 -07:00 committed by GitHub
parent 8d75b25104
commit 7fdc862042
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
157 changed files with 4836 additions and 2403 deletions

View file

@ -15,9 +15,7 @@ export default defineConfig({
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: [
['html', { outputFolder: 'playwright-report' }]
],
reporter: [['html', { outputFolder: 'playwright-report' }]],
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
baseURL: 'http://localhost:3080',
@ -25,17 +23,17 @@ export default defineConfig({
trace: 'retain-on-failure',
headless: true,
storageState: path.resolve('./e2e/storageState.json'),
screenshot: 'only-on-failure',
screenshot: 'only-on-failure'
},
expect: {
timeout: 10000,
timeout: 10000
},
/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
use: { ...devices['Desktop Chrome'] }
}
// Note: enabling these will slow down the CI and is probably unnecessary.
// {
@ -74,6 +72,6 @@ export default defineConfig({
command: 'node ../api/server/index.js',
url: 'http://localhost:3080',
timeout: 30_000,
reuseExistingServer: !process.env.CI,
},
reuseExistingServer: !process.env.CI
}
});

View file

@ -1,8 +1,9 @@
import { expect, test } from '@playwright/test';
test('landing page', async ({ page }) => {
await page.goto('http://localhost:3080/');
// expect (await page.title()).toBe('ChatGPT Clone');
expect(await page.textContent('#landing-title')).toBe(import.meta.env.VITE_APP_TITLE || "ChatGPT Clone");
});
expect(await page.textContent('#landing-title')).toBe(
import.meta.env.VITE_APP_TITLE || 'ChatGPT Clone'
);
});