aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2024-10-21 07:16:12 +0300
committerGravatar Vitaly Takmazov2024-10-21 07:36:03 +0300
commitd2bbbccc945db0059ef2a99b6eed4eadaf22bce0 (patch)
treeb952da2e4fdd0dae5d44fc0f8e10405c4d8bec23
parentdd962bcb1ebcbff9dd28ada9156786b9a9ed92a6 (diff)
vnext: configure test environment
-rw-r--r--config/test.json9
-rw-r--r--package.json2
-rw-r--r--vnext/server/middleware/webfinger.spec.js6
3 files changed, 12 insertions, 5 deletions
diff --git a/config/test.json b/config/test.json
index 0967ef42..fb3fae9d 100644
--- a/config/test.json
+++ b/config/test.json
@@ -1 +1,8 @@
-{}
+{
+ "service": {
+ "baseURL": "https://example.lan",
+ "user": "juick",
+ "password": "secret",
+ "sandboxIds": []
+ }
+}
diff --git a/package.json b/package.json
index fb00c535..04934de5 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,7 @@
"lint": "eslint src/main/assets",
"vnext:build": "webpack -c vnext/webpack.config.js --mode production --progress",
"vnext:build:ssr": "npm run vnext:build && webpack -c vnext/server/webpack.config.js --mode production",
- "vnext:start-ssr": "npm run vnext:build && webpack -c vnext/server/webpack.config.js --mode development && cross-env DEBUG=http node --enable-source-maps public/server.js",
+ "vnext:start-ssr": "npm run vnext:build && webpack -c vnext/server/webpack.config.js --mode development && cross-env DATABASE_URL=sqlite:juick.db DEBUG=http node --enable-source-maps public/server.js",
"vnext:start": "webpack serve -c vnext/webpack.config.js --mode development",
"vnext:lint": "eslint vnext"
},
diff --git a/vnext/server/middleware/webfinger.spec.js b/vnext/server/middleware/webfinger.spec.js
index efdfff20..d1b198e6 100644
--- a/vnext/server/middleware/webfinger.spec.js
+++ b/vnext/server/middleware/webfinger.spec.js
@@ -4,16 +4,16 @@ import { app } from '../app'
describe('WebFinger middleware', () => {
it('Existing user response should have a subject and links', async () => {
- const resource = 'acct:ugnich@juick.com'
+ const resource = 'acct:ugnich@example.lan'
const response = await request(app)
.get(`/.well-known/webfinger?resource=${resource}`)
expect(response.status).toStrictEqual(200)
expect(response.body.subject).toStrictEqual(resource)
expect(response.body.links.length).toStrictEqual(1)
- expect(response.body.links[0].href).toStrictEqual('https://juick.com/u/ugnich')
+ expect(response.body.links[0].href).toStrictEqual('https://example.lan/u/ugnich')
})
it('Unknown user should return 404', async () => {
- const resource = 'acct:durov@juick.com'
+ const resource = 'acct:durov@example.lan'
const response = await request(app)
.get(`/.well-known/webfinger?resource=${resource}`)
expect(response.status).toStrictEqual(404)