From 498edcb2152d2a56d1bab41baede0c77d884cf3b Mon Sep 17 00:00:00 2001 From: counterweight Date: Fri, 14 Feb 2025 14:59:46 +0100 Subject: [PATCH] first test --- package-lock.json | 61 +++++++++++++++++++++++++++++++++++++ package.json | 4 ++- test-results/.last-run.json | 4 +++ tests/app.spec.js | 6 ++++ 4 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 test-results/.last-run.json create mode 100644 tests/app.spec.js diff --git a/package-lock.json b/package-lock.json index 7213483..5490e56 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,9 +23,11 @@ }, "devDependencies": { "@eslint/js": "^9.20.0", + "@playwright/test": "^1.50.1", "eslint-config-prettier": "^10.0.1", "eslint-plugin-prettier": "^5.2.3", "globals": "^15.15.0", + "playwright": "^1.50.1", "prettier": "^3.5.1", "prettier-plugin-ejs": "^1.0.3" } @@ -300,6 +302,21 @@ "url": "https://opencollective.com/unts" } }, + "node_modules/@playwright/test": { + "version": "1.50.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.50.1.tgz", + "integrity": "sha512-Jii3aBg+CEDpgnuDxEp/h7BimHcUTDlpEtce89xEumlJ5ef2hqepZ+PWp1DDpYC/VO9fmWVI1IlEaoI5fK9FXQ==", + "dev": true, + "dependencies": { + "playwright": "1.50.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@scure/base": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.1.tgz", @@ -1532,6 +1549,20 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -2665,6 +2696,36 @@ "split2": "^4.1.0" } }, + "node_modules/playwright": { + "version": "1.50.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.50.1.tgz", + "integrity": "sha512-G8rwsOQJ63XG6BbKj2w5rHeavFjy5zynBA9zsJMMtBoe/Uf757oG12NXz6e6OirF7RCrTVAKFXbLmn1RbL7Qaw==", + "dev": true, + "dependencies": { + "playwright-core": "1.50.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.50.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.50.1.tgz", + "integrity": "sha512-ra9fsNWayuYumt+NiM069M6OkcRb1FZSK8bgi66AtpFoWkg2+y0bJSNmkFrWhMbEBbVKC/EruAHH3g0zmtwGmQ==", + "dev": true, + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/postgres-array": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", diff --git a/package.json b/package.json index eaec6fb..3c1c48d 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "start:containers": "docker compose up -d --build", "stop:containers": "docker compose down", "cli": "node src/cli.js", - "test": "echo \"Error: no test specified\" && exit 1", + "test": "playwright test", "lint": "eslint . --fix", "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,scss,html,ejs}\"" }, @@ -30,9 +30,11 @@ "license": "ISC", "devDependencies": { "@eslint/js": "^9.20.0", + "@playwright/test": "^1.50.1", "eslint-config-prettier": "^10.0.1", "eslint-plugin-prettier": "^5.2.3", "globals": "^15.15.0", + "playwright": "^1.50.1", "prettier": "^3.5.1", "prettier-plugin-ejs": "^1.0.3" } diff --git a/test-results/.last-run.json b/test-results/.last-run.json new file mode 100644 index 0000000..cbcc1fb --- /dev/null +++ b/test-results/.last-run.json @@ -0,0 +1,4 @@ +{ + "status": "passed", + "failedTests": [] +} \ No newline at end of file diff --git a/tests/app.spec.js b/tests/app.spec.js new file mode 100644 index 0000000..fae9b66 --- /dev/null +++ b/tests/app.spec.js @@ -0,0 +1,6 @@ +const { test, expect } = require('@playwright/test'); + +test('Home page has correct title', async () => { + const isTrue = true; + expect(isTrue).toBe(true); +});