Skip to content

Commit 8359d59

Browse files
authored
Merge pull request #792 from nextcloud/feat/add-js-tests
add basic JS tests
2 parents df37667 + 8aa97af commit 8359d59

17 files changed

+3171
-389
lines changed

.github/workflows/js-test.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
2+
# SPDX-License-Identifier: MIT
3+
4+
name: JavaScript tests
5+
6+
on:
7+
pull_request:
8+
push:
9+
branches: [main]
10+
11+
permissions:
12+
contents: read
13+
14+
concurrency:
15+
group: js-test-${{ github.head_ref || github.run_id }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
changes:
20+
runs-on: ubuntu-latest-low
21+
permissions:
22+
contents: read
23+
pull-requests: read
24+
25+
outputs:
26+
src: ${{ steps.changes.outputs.src }}
27+
28+
steps:
29+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
30+
id: changes
31+
continue-on-error: true
32+
with:
33+
filters: |
34+
src:
35+
- 'src/**'
36+
- 'package.json'
37+
- 'package-lock.json'
38+
- 'vitest.config.mjs'
39+
40+
test:
41+
runs-on: ubuntu-latest
42+
needs: changes
43+
if: needs.changes.outputs.src != 'false'
44+
45+
name: Vitest
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
49+
with:
50+
persist-credentials: false
51+
52+
- name: Read package.json node and npm engines version
53+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
54+
id: versions
55+
with:
56+
fallbackNode: '^24'
57+
fallbackNpm: '^11.3'
58+
59+
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
60+
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
61+
with:
62+
node-version: ${{ steps.versions.outputs.nodeVersion }}
63+
64+
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
65+
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
66+
67+
- name: Install dependencies
68+
run: npm ci
69+
70+
- name: Run tests
71+
run: npm test
72+
73+
summary:
74+
permissions:
75+
contents: none
76+
runs-on: ubuntu-latest-low
77+
needs: [changes, test]
78+
if: always()
79+
name: js-test
80+
81+
steps:
82+
- name: Summary status
83+
run: if ${{ needs.changes.outputs.src != 'false' && needs.test.result != 'success' }}; then exit 1; fi

js/app_api-adminSettings.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/app_api-adminSettings.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/app_api-filesplugin.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/app_api-filesplugin.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/app_api-vendors-node_modules_nextcloud_dialogs_dist_chunks__plugin-vue_export-helper-1tPrXgE0_mjs-nod-dc4ad5.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/app_api-vendors-node_modules_nextcloud_dialogs_dist_chunks__plugin-vue_export-helper-1tPrXgE0_mjs-nod-dc4ad5.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)