Skip to content
This repository was archived by the owner on Jul 26, 2025. It is now read-only.

Commit 3a8833a

Browse files
authored
test: replace Jest with Vitest (#317)
1 parent 928b6e7 commit 3a8833a

File tree

455 files changed

+1833
-1808
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

455 files changed

+1833
-1808
lines changed

.eslintrc.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/workflows/release-head.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- uses: actions/checkout@v4
1111
- uses: actions/setup-node@v4
1212
with:
13-
node-version: '20.x'
13+
node-version: '22.x'
1414
registry-url: 'https://registry.npmjs.org'
1515
- name: Install dependencies
1616
run: npm install

.github/workflows/typedoc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
pull_request:
99

1010
env:
11-
NODE_VERSION: 20.x
11+
NODE_VERSION: 22.x
1212
ENTRY_FILE: 'src/index.ts'
1313

1414
jobs:

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ yarn.lock
124124
.DS_Store
125125

126126
lib
127-
lib-esm
127+
lib-cjs
128128

129129
# debug images
130130
src/**/*.tif
@@ -136,3 +136,5 @@ scripts/**/**.png
136136
scripts/**/**.json
137137

138138
private
139+
140+
.jest-image-snapshot-touched-files

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ Image processing and manipulation in JavaScript.
1313

1414
## [API](https://image-js.github.io/image-js-typescript/)
1515

16-
Look at the [examples](./examples) directory for how the API is being designed.
17-
1816
## Development
1917

2018
See [Development documentation](./Development.md).

api-extractor.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
*
4646
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
4747
*/
48-
"mainEntryPointFilePath": "<projectFolder>/lib-esm/index.d.ts",
48+
"mainEntryPointFilePath": "<projectFolder>/lib/index.d.ts",
4949

5050
/**
5151
* A list of NPM package names whose exports should be treated as part of this package.

demo/.eslintrc.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
root: true
2-
extends: [cheminfo-react, cheminfo-typescript]
3-
rules:
4-
no-console: off

demo/components/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { HashRouter, Route, Routes } from 'react-router-dom';
22

3-
import { CameraProvider } from '../contexts/cameraContext';
3+
import { CameraProvider } from '../contexts/cameraContext.provider.js';
44

5-
import Filters from './Filters';
6-
import Home from './Home';
5+
import Filters from './Filters.js';
6+
import Home from './Home.js';
77

88
export default function App() {
99
return (

demo/components/CameraFeed.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { useEffect, useRef } from 'react';
22

3-
import { useCameraContext } from '../contexts/cameraContext';
3+
import { useCameraContext } from '../contexts/cameraContext.js';
44

5-
import UnavailableCamera from './UnavailableCamera';
5+
import UnavailableCamera from './UnavailableCamera.js';
66

77
export default function CameraFeed() {
88
const [{ selectedCamera }] = useCameraContext();
@@ -11,8 +11,12 @@ export default function CameraFeed() {
1111
const video = videoRef.current;
1212
if (!video || !selectedCamera) return;
1313
video.srcObject = selectedCamera.stream;
14-
video.onloadedmetadata = () => {
15-
video.play().catch((err: unknown) => console.error(err));
14+
const onLoadedMetadata = () => {
15+
video.play().catch((error: unknown) => console.error(error));
16+
};
17+
video.addEventListener('loadedmetadata', onLoadedMetadata);
18+
return () => {
19+
video.removeEventListener('loadedmetadata', onLoadedMetadata);
1620
};
1721
}, [selectedCamera]);
1822
if (!selectedCamera) {

demo/components/CameraSelector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useCameraContext } from '../contexts/cameraContext';
1+
import { useCameraContext } from '../contexts/cameraContext.js';
22

33
export default function CameraSelector() {
44
const [{ cameras, selectedCamera }, dispatch] = useCameraContext();
@@ -29,7 +29,7 @@ export default function CameraSelector() {
2929
camera: { device, stream },
3030
});
3131
})
32-
.catch((err: unknown) => console.error(err));
32+
.catch((error: unknown) => console.error(error));
3333
}
3434
}}
3535
>

0 commit comments

Comments
 (0)