Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ temp
.env
GITHUB_ENV
playground/**.d.ts
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"prepublishOnly": "nr build",
"bump": "esno scripts/bump.ts",
"test": "vitest",
"test:e2e": "playwright test",
"test:e2e:ui": "playwright test --ui",
"fetch": "esno scripts/fetch.ts && eslint . --fix",
"fetch:force": "esno scripts/fetch.ts --force && eslint . --fix",
"typecheck": "tsc --noEmit",
Expand All @@ -21,6 +23,8 @@
"@antfu/eslint-config": "^2.16.1",
"@antfu/ni": "^0.21.12",
"@antfu/utils": "^0.7.7",
"@axe-core/playwright": "^4.9.1",
"@playwright/test": "^1.44.1",
"@types/adm-zip": "^0.5.5",
"@types/cson": "^7.20.3",
"@types/js-yaml": "^4.0.9",
Expand Down
8 changes: 5 additions & 3 deletions playground/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,9 @@ if (import.meta.hot) {
<button
v-for="g of filteredGrammars"
:key="g.name"
border="b base" px3
py1 text-left
:data-testid="g.name" border="b base"
px3 py1
text-left
:class="g.name === grammar ? 'bg-active text-primary' : 'text-faded'"
@click="grammar = g.name"
>
Expand All @@ -238,6 +239,7 @@ if (import.meta.hot) {
<button
v-for="t of filteredThemes"
:key="t.name"
:data-testid="t.name"
border="b base" px3 py1 text-left
:class="t.name === theme ? 'bg-active text-purple' : 'text-faded'"
@click="theme = t.name"
Expand Down Expand Up @@ -302,7 +304,7 @@ if (import.meta.hot) {
{{ error }}
</div>
<div relative of-x-scroll flex-none>
<div v-html="output" />
<div id="code-output" v-html="output" />
<textarea
id="input"
v-model="input"
Expand Down
50 changes: 50 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import process from 'node:process'
import { defineConfig, devices } from '@playwright/test'

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config();

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
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. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : 10,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: [['dot'], ['json', { outputFile: 'test-results.json' }]], // ['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://localhost:3333',

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

quiet: true,

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

/* Run your local dev server before starting the tests */
webServer: {
command: 'pnpm play',
url: 'http://localhost:3333',
reuseExistingServer: !process.env.CI,
},
})
57 changes: 57 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading