Skip to content

Commit 19e1cf2

Browse files
committed
test: add test-formats. #313 #517
1 parent 34f7e53 commit 19e1cf2

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- run: npm install
3333
- run: npm run build
3434
- run: npm run test
35-
- run: cp test/test-formats.html doc/test-formats.html
35+
- run: cp -rp dist doc
3636

3737
- name: Generate Contributors Images
3838
uses: jaywcjlove/github-action-contributors@main

.npmignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Exclude test files
2+
dist/test-formats.html
3+
4+
# Exclude development files
5+
src/
6+
test/
7+
website/
8+
coverage/
9+
10+
# Exclude configuration files
11+
*.config.ts
12+
*.config.js
13+
eslint.config.js
14+
tsconfig.json
15+
16+
# Exclude other unnecessary files
17+
README-zh.md
18+
DISTRIBUTION-GUIDE.md
19+
DISTRIBUTION-GUIDE-zh.md
20+
.github/
21+
.gitignore
22+
.husky/

test/test-formats.html renamed to dist/test-formats.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ <h3>3. ES Module Format Test (hotkeys-js.js)</h3>
5555
</div>
5656

5757
<!-- Test IIFE -->
58-
<script src="../dist/hotkeys-js.min.js"></script>
58+
<script src="./hotkeys-js.min.js"></script>
5959
<script>
6060
try {
6161
if (typeof hotkeys !== 'undefined') {
@@ -77,7 +77,7 @@ <h3>3. ES Module Format Test (hotkeys-js.js)</h3>
7777
// Clear previous hotkeys instance to test UMD independently
7878
window.hotkeys = undefined;
7979
</script>
80-
<script src="../dist/hotkeys-js.umd.cjs"></script>
80+
<script src="./hotkeys-js.umd.cjs"></script>
8181
<script>
8282
try {
8383
if (typeof hotkeys !== 'undefined') {
@@ -97,7 +97,7 @@ <h3>3. ES Module Format Test (hotkeys-js.js)</h3>
9797
<!-- Test ES Module -->
9898
<script type="module">
9999
try {
100-
const { default: hotkeys } = await import('../dist/hotkeys-js.js');
100+
const { default: hotkeys } = await import('./hotkeys-js.js');
101101
hotkeys('f3', function(event, handler) {
102102
event.preventDefault();
103103
alert('ES Module Format: F3 pressed successfully!');

0 commit comments

Comments
 (0)