Skip to content

Commit 0a98202

Browse files
committed
Change workflow to use node 18
1 parent eada17d commit 0a98202

4 files changed

Lines changed: 11 additions & 10 deletions

File tree

.github/workflows/nodejs.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ jobs:
55
runs-on: ubuntu-latest
66
steps:
77
- uses: actions/checkout@v2
8-
- name: Use Node.js
8+
- name: Use Node.js 18.x
99
uses: actions/setup-node@v1
1010
with:
11-
node-version: '14.x'
12-
- run: npm install
13-
- run: npm run build --if-present
14-
- run: npm test
11+
node-version: 18.x
12+
- name: npm install, build, and test
13+
run: |
14+
npm install
15+
npm run build --if-present
16+
npm test
1517
env:
1618
CI: true
19+

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- uses: actions/checkout@v3
1212
- uses: actions/setup-node@v3
1313
with:
14-
node-version: 14
14+
node-version: 18
1515
registry-url: https://registry.npmjs.org/
1616
cache: npm
1717
- run: npm ci
@@ -21,4 +21,4 @@ jobs:
2121
TAG_NAME: ${{ github.event.release.tag_name }}
2222
- run: npm whoami; npm --ignore-scripts publish
2323
env:
24-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
24+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"prebuild": "npm run clean && npm run lint && npm run compile",
1717
"compile": "tsc",
1818
"build": "rollup -c",
19-
"pretest": "npm run build",
2019
"test": "vitest run",
2120
"test:watch": "vitest",
2221
"test:legacy": "karma start karma.config.js",

test/setup.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { vi } from 'vitest'
21
import FileAttachmentElement from '../src/file-attachment-element'
32

43
// Define a global CustomEvent class if not already available
@@ -13,7 +12,7 @@ if (typeof window.CustomEvent !== 'function') {
1312
}
1413

1514
// Register the custom element before running tests
16-
customElements.define('file-attachment', FileAttachmentElement)
15+
customElements.get('file-attachment') || customElements.define('file-attachment', FileAttachmentElement)
1716

1817
// Mock window.FileAttachmentElement for element creation tests
1918
Object.defineProperty(window, 'FileAttachmentElement', {

0 commit comments

Comments
 (0)