mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-24 19:26:14 +01:00
ci(backend-review.yml): add linter step to the backend review workflow (#625)
* ci(backend-review.yml): add linter step to the backend review workflow * chore(backend-review.yml): remove prettier from lint-action configuration * chore: apply new linting workflow * chore(lint-staged.config.js): reorder lint-staged tasks for JavaScript and TypeScript files * chore(eslint): update ignorePatterns in .eslintrc.js chore(lint-action): remove prettier option in backend-review.yml chore(package.json): add lint and lint:fix scripts * chore(lint-staged.config.js): remove prettier --write command for js, jsx, ts, tsx files * chore(titleConvo.js): remove unnecessary console.log statement chore(titleConvo.js): add missing comma in options object * chore: apply linting to all files * chore(lint-staged.config.js): update lint-staged configuration to include prettier formatting
This commit is contained in:
parent
637bb6bc11
commit
e5336039fc
231 changed files with 1688 additions and 1526 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import {PlaywrightTestConfig} from '@playwright/test';
|
||||
import { PlaywrightTestConfig } from '@playwright/test';
|
||||
import mainConfig from './playwright.config';
|
||||
|
||||
const config: PlaywrightTestConfig = {
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ export default defineConfig({
|
|||
globalSetup: require.resolve('./setup/global-setup'),
|
||||
testDir: 'specs/',
|
||||
outputDir: 'specs/.test-results',
|
||||
/* Run tests in files in parallel.
|
||||
NOTE: This sometimes causes issues on Windows.
|
||||
/* Run tests in files in parallel.
|
||||
NOTE: This sometimes causes issues on Windows.
|
||||
Set to false if you experience issues running on a Windows machine. */
|
||||
fullyParallel: true,
|
||||
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
||||
|
|
@ -25,16 +25,16 @@ export default defineConfig({
|
|||
ignoreHTTPSErrors: true,
|
||||
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'] },
|
||||
},
|
||||
/* Test against mobile viewports. */
|
||||
// {
|
||||
|
|
@ -53,6 +53,6 @@ export default defineConfig({
|
|||
port: 3080,
|
||||
// url: 'http://localhost:3080',
|
||||
timeout: 30_000,
|
||||
reuseExistingServer: true
|
||||
reuseExistingServer: true,
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import {Page, FullConfig, chromium} from '@playwright/test';
|
||||
import { Page, FullConfig, chromium } from '@playwright/test';
|
||||
|
||||
type User = {username: string; password: string};
|
||||
|
||||
|
|
@ -10,7 +10,7 @@ async function login(page: Page, user: User) {
|
|||
|
||||
async function authenticate(config: FullConfig, user: User) {
|
||||
console.log('🤖: global setup has been started');
|
||||
const {baseURL, storageState} = config.projects[0].use;
|
||||
const { baseURL, storageState } = config.projects[0].use;
|
||||
console.log('🤖: using baseURL', baseURL);
|
||||
const browser = await chromium.launch();
|
||||
const page = await browser.newPage();
|
||||
|
|
@ -24,7 +24,7 @@ async function authenticate(config: FullConfig, user: User) {
|
|||
localStorage.setItem('navVisible', 'true');
|
||||
});
|
||||
console.log('🤖: ✔️ localStorage: set Nav as Visible', storageState);
|
||||
await page.context().storageState({path: storageState as string});
|
||||
await page.context().storageState({ path: storageState as string });
|
||||
console.log('🤖: ✔️ authentication state successfully saved in', storageState);
|
||||
await browser.close();
|
||||
console.log('🤖: global setup has been finished');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import {FullConfig} from '@playwright/test';
|
||||
import { FullConfig } from '@playwright/test';
|
||||
import localUser from '../config.local';
|
||||
import authenticate from './authenticate';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import {FullConfig} from '@playwright/test';
|
||||
import { FullConfig } from '@playwright/test';
|
||||
import authenticate from './authenticate';
|
||||
|
||||
async function globalSetup(config: FullConfig) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { expect, test } from '@playwright/test';
|
|||
|
||||
test.describe('Landing suite', () => {
|
||||
|
||||
test('Landing title', async ({page}) => {
|
||||
test('Landing title', async ({ page }) => {
|
||||
await page.goto('http://localhost:3080/');
|
||||
const pageTitle = await page.textContent('#landing-title');
|
||||
expect(pageTitle.length).toBeGreaterThan(0);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ function isUUID(uuid) {
|
|||
|
||||
test.describe('Messaging suite', () => {
|
||||
|
||||
test('textbox should be focused after receiving message & test expected navigation', async ({page}) => {
|
||||
test('textbox should be focused after receiving message & test expected navigation', async ({ page }) => {
|
||||
test.setTimeout(120000);
|
||||
const message = 'hi';
|
||||
const endpoint = endpoints[1];
|
||||
|
|
@ -26,12 +26,12 @@ test.describe('Messaging suite', () => {
|
|||
page.waitForResponse(async (response) => {
|
||||
return response.url().includes(`/api/ask/${endpoint}`) && response.status() === 200;
|
||||
}),
|
||||
page.locator('form').getByRole('textbox').press('Enter')
|
||||
page.locator('form').getByRole('textbox').press('Enter'),
|
||||
];
|
||||
|
||||
const [response] = await Promise.all(responsePromise);
|
||||
const responseBody = await response.body();
|
||||
const messageSuccess = responseBody.includes(`"final":true`);
|
||||
const messageSuccess = responseBody.includes('"final":true');
|
||||
expect(messageSuccess).toBe(true);
|
||||
|
||||
// Check if textbox is focused
|
||||
|
|
|
|||
|
|
@ -15,13 +15,13 @@ test.describe('Settings suite', () => {
|
|||
const button2 = await page.getByRole('button', { name: 'Mode: Sydney' });
|
||||
|
||||
try {
|
||||
await button1.click({ timeout: 100});
|
||||
await button1.click({ timeout: 100 });
|
||||
} catch (e) {
|
||||
// console.log('Bing button', e);
|
||||
}
|
||||
|
||||
try {
|
||||
await button2.click({ timeout: 100});
|
||||
await button2.click({ timeout: 100 });
|
||||
} catch (e) {
|
||||
// console.log('Sydney button', e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue