Skip to content

Commit

Permalink
fix prettier formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
neozenith committed Jan 17, 2025
1 parent 953f219 commit f91d752
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 37 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
branches: [main, master]
pull_request:
branches: [ main, master ]
branches: [main, master]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
16 changes: 8 additions & 8 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig, devices } from '@playwright/test';
import { defineConfig, devices } from "@playwright/test";

/**
* Read environment variables from file.
Expand All @@ -12,7 +12,7 @@ import { defineConfig, devices } from '@playwright/test';
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests',
testDir: "./tests",
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
Expand All @@ -22,21 +22,21 @@ 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',
reporter: "html",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
trace: "on-first-retry",
},

/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},

// {
Expand Down Expand Up @@ -72,8 +72,8 @@ export default defineConfig({

/* Run your local dev server before starting the tests */
webServer: {
command: 'npm run dev',
url: 'http://127.0.0.1:9000',
command: "npm run dev",
url: "http://127.0.0.1:9000",
reuseExistingServer: !process.env.CI,
},
});
11 changes: 6 additions & 5 deletions src/js/events/Meetup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { events } from "./events-data";
*/
// @ts-ignore
const eventIdNode: HTMLElement = document.getElementById("meetupEvents");
import showdown from "showdown"
import DOMPurify from 'dompurify';
import showdown from "showdown";
import DOMPurify from "dompurify";

export class Meetup extends Component {
/**
Expand Down Expand Up @@ -39,7 +39,7 @@ export class Meetup extends Component {
const prettyTime = this.niceTime(startTime);
const converter = new showdown.Converter();
let formattedEventDescription = converter.makeHtml(event.description.substring(0, 240)).toString();
formattedEventDescription = formattedEventDescription.replace(/<\/?p>/g, '');
formattedEventDescription = formattedEventDescription.replace(/<\/?p>/g, "");

return (
<li class="eventItem">
Expand All @@ -60,8 +60,9 @@ export class Meetup extends Component {
Hosted by: <a href={`https://meetup.com/${group.urlname}`}>{group.name}</a>
</p>

<p class="eventItem-description"
dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(formattedEventDescription) }}
<p
class="eventItem-description"
dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(formattedEventDescription) }}
/>
<ul class="eventItem-stats">
<li class="eventItem-stats_rsvp" title="Number of people who have RSVP'd vs. the total number of spots">
Expand Down
6 changes: 3 additions & 3 deletions tests/website.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test, expect } from '@playwright/test';
import { test, expect } from "@playwright/test";

test('has title', async ({ page }) => {
await page.goto('localhost:9000');
test("has title", async ({ page }) => {
await page.goto("localhost:9000");

// Expect a title "to contain" a substring.
await expect(page).toHaveTitle("Newie | an open community of digital creators in newcastle nsw.");
Expand Down
5 changes: 2 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;

module.exports = {
mode: "production",
Expand All @@ -22,7 +21,7 @@ module.exports = {
new CssMinimizerPlugin(),
],
splitChunks: {
chunks: 'all',
chunks: "all",
minSize: 20000,
maxSize: 244000, // Adjust this limit based on your target size
},
Expand Down

0 comments on commit f91d752

Please sign in to comment.