Migrate from CRA to Vite (#170)

* Basic CRA to Vite conversion

* Restore ESLint support

* Remove semicolons from vite config

* Add vite client types to tsconfig

* Migrate to Vitest for testing (not working on Mac)

* some test progress (#175)

* some test progress

* something maybe working

* remove local lib

* small clean up

* tweaks

* fix dependency

* clean up deps

* remove vitest import

* vitest config is needed even though we're not using vitest

* more tweaks to vite config

---------

Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
This commit is contained in:
Frank Noirot
2023-07-20 19:25:04 -04:00
committed by GitHub
parent 1666e17ca5
commit b89faa4a28
22 changed files with 2554 additions and 6386 deletions

View File

@ -1,20 +1,6 @@
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom'
import WebSocket from 'ws';
import 'setimmediate'
class WebsocketWrapper {
constructor(url: string) {
return new WebSocket(url, {
headers: {
'Autherization': `Bearer ${process.env.KITTYCAD_TOKEN}`,
}
})
}
}
import util from 'util'
import fetch from 'isomorphic-fetch'
class MockRTCPeerConnection {
constructor() {
@ -51,4 +37,8 @@ class MockRTCPeerConnection {
// @ts-ignore
global.RTCPeerConnection = MockRTCPeerConnection
// @ts-ignore
global.WebSocket = WebsocketWrapper
global.fetch = fetch
// @ts-ignore
global.TextDecoder = util.TextDecoder
global.TextEncoder = util.TextEncoder