mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-07-28 20:24:38 +02:00
enhance: Set default Node.js version to v26 (#17623)
* enhance: Set default Node.js version to v26
* fix
* Update Changelog
* fix types
* drop node v22
* update changelog
* fix test
* update
* fix test
* fix test
* Revert "drop node v22"
This reverts commit bb4e011628.
* fix changelog
* attempt to fix test
* attempt to fix test
* fix: update re2 that supports node 26
* attempt to fix test
* attempt to fix test
* run pnpm dedupe
* restore 2fa e2e
* refactor
* attempt to fix test
* attempt to fix test
* run pnpm dedupe
* attempt to fix test
This commit is contained in:
@@ -99,7 +99,7 @@
|
||||
"@types/insert-text-at-cursor": "0.3.2",
|
||||
"@types/matter-js": "0.20.2",
|
||||
"@types/micromatch": "4.0.10",
|
||||
"@types/node": "24.13.2",
|
||||
"@types/node": "26.0.0",
|
||||
"@types/punycode.js": "npm:@types/punycode@2.1.4",
|
||||
"@types/sanitize-html": "2.16.1",
|
||||
"@types/seedrandom": "3.0.8",
|
||||
|
||||
@@ -7,18 +7,46 @@ import { vi } from 'vitest';
|
||||
import createFetchMock from 'vitest-fetch-mock';
|
||||
import type { Ref } from 'vue';
|
||||
import { ref } from 'vue';
|
||||
// Set i18n
|
||||
import locales from 'i18n';
|
||||
import { updateI18n } from '@/i18n.js';
|
||||
|
||||
const fetchMocker = createFetchMock(vi);
|
||||
fetchMocker.enableMocks();
|
||||
|
||||
updateI18n(locales['en-US']);
|
||||
|
||||
// XXX: misskey-js panics if WebSocket is not defined
|
||||
vi.stubGlobal('WebSocket', class WebSocket extends EventTarget { static CLOSING = 2; });
|
||||
|
||||
// XXX: localStorageがない場合がある
|
||||
const localStorageMock = (() => {
|
||||
const store = new Map<string, string>();
|
||||
return {
|
||||
getItem(key: string) {
|
||||
return store.get(key) ?? null;
|
||||
},
|
||||
setItem(key: string, value: string) {
|
||||
store.set(key, value);
|
||||
},
|
||||
removeItem(key: string) {
|
||||
store.delete(key);
|
||||
},
|
||||
clear() {
|
||||
store.clear();
|
||||
},
|
||||
};
|
||||
})();
|
||||
vi.stubGlobal('localStorage', localStorageMock);
|
||||
|
||||
// 中でlocalStorageを使うので上と順番を変えてはいけない
|
||||
const { default: locales } = await import('i18n');
|
||||
|
||||
fetchMocker.mockIf(/^\/assets\/locales\/.*\.json$/, async () => {
|
||||
return {
|
||||
status: 200,
|
||||
body: JSON.stringify(locales['en-US']),
|
||||
};
|
||||
});
|
||||
|
||||
const { updateI18n } = await import('@/i18n.js');
|
||||
updateI18n(locales['en-US']);
|
||||
|
||||
export const preferState: Record<string, unknown> = {
|
||||
|
||||
// なんかtestがうまいこと動かないのでここに書く
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/// <reference types="vitest/config" />
|
||||
|
||||
import path from 'path';
|
||||
import pluginVue from '@vitejs/plugin-vue';
|
||||
import pluginGlsl from 'vite-plugin-glsl';
|
||||
@@ -265,6 +264,7 @@ export function getConfig(): UserConfig {
|
||||
|
||||
test: {
|
||||
environment: 'happy-dom',
|
||||
setupFiles: ['./test/init.ts'],
|
||||
deps: {
|
||||
optimizer: {
|
||||
web: {
|
||||
|
||||
Reference in New Issue
Block a user