Skip to content

Commit

Permalink
Merge pull request #5 from shinshin86/fix/disabled-opfs-e2e
Browse files Browse the repository at this point in the history
Fix problem disabled of OPFS at e2e
  • Loading branch information
shinshin86 authored Sep 30, 2024
2 parents 49c7fba + 22d7c9d commit 8614d31
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ test-results

# mac
.DS_Store

# coi-serviceworker
# These files are included in the .gitignore because they are automatically generated during the build process.
# Run npm run build:e2e to generate the necessary files and place them in the correct location.
e2e/coi-serviceworker.js
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ All tests are tested only through Playwright.
* Google Chrome
* Microsoft Edge
* Firefox
* Safari
* ~~Safari~~ (https://github.com/shinshin86/neverchange/issues/6)

### Requirements

Expand Down
1 change: 1 addition & 0 deletions e2e/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html>
<head>
<title>NeverChangeDB Test</title>
<script src="/coi-serviceworker.js"></script>
</head>
<body>
<h1>NeverChangeDB Test Page</h1>
Expand Down
3 changes: 1 addition & 2 deletions e2e/neverchange.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ test.describe("NeverChangeDB", () => {
expect(closed).toBe(true);
});

// if OPFS is disabled, this test will fail
test.skip("should persist data between connections", async ({ page }) => {
test("should persist data between connections", async ({ page }) => {
await page.evaluate(async () => {
const db1 = new (window as any).NeverChangeDB("persist-test-db");
await db1.init();
Expand Down
8 changes: 8 additions & 0 deletions package-lock.json

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

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
},
"scripts": {
"build": "vite build && tsc",
"dev:e2e": "vite --mode e2e",
"e2e": "playwright test",
"e2e": "npm run build:e2e && playwright test",
"setupcoi:e2e": "cp node_modules/coi-serviceworker/coi-serviceworker.js e2e",
"build:e2e": "vite build && tsc && npm run setupcoi:e2e",
"dev:e2e": "npm run build:e2e && vite --mode e2e",
"fmt": "biome format --write src e2e ",
"prepublishOnly": "npm run build"
},
Expand Down Expand Up @@ -53,6 +55,7 @@
"@biomejs/biome": "1.8.3",
"@playwright/test": "^1.46.1",
"@types/node": "^22.5.2",
"coi-serviceworker": "^0.1.7",
"playwright": "^1.46.1",
"typescript": "^5.5.3",
"vite": "^5.4.2"
Expand Down
7 changes: 0 additions & 7 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ export default defineConfig({
headless: true,
},
},
{
name: 'webkit',
use: {
...devices['Desktop Safari'],
headless: true,
},
},
],
webServer: {
command: 'npm run dev:e2e',
Expand Down

0 comments on commit 8614d31

Please sign in to comment.