mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
use src/constants (abs path) so it can remap when jest runs
This commit is contained in:
parent
51d3d9f473
commit
6c73cfddc9
4 changed files with 6 additions and 12 deletions
|
|
@ -1,16 +1,10 @@
|
||||||
//WebsocketService.test.tsx
|
//WebsocketService.test.tsx
|
||||||
import WebsocketService from '../../services/WebsocketService';
|
import WebsocketService from '../../services/WebsocketService';
|
||||||
import { io, Socket } from 'socket.io-client';
|
import { io, Socket } from 'socket.io-client';
|
||||||
import { ENV_VARIABLES } from '../../constants';
|
import { ENV_VARIABLES } from 'src/constants';
|
||||||
|
|
||||||
jest.mock('socket.io-client');
|
jest.mock('socket.io-client');
|
||||||
|
|
||||||
// jest.mock('../../constants', () => ({
|
|
||||||
// ENV_VARIABLES: {
|
|
||||||
// VITE_BACKEND_SOCKET_URL: 'https://ets-glitch-backend.glitch.me/'
|
|
||||||
// }
|
|
||||||
// }));
|
|
||||||
|
|
||||||
describe('WebSocketService', () => {
|
describe('WebSocketService', () => {
|
||||||
let mockSocket: Partial<Socket>;
|
let mockSocket: Partial<Socket>;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
|
|
||||||
import { Socket } from 'socket.io-client';
|
import { Socket } from 'socket.io-client';
|
||||||
import { ENV_VARIABLES } from '../../../constants';
|
import { ENV_VARIABLES } from 'src/constants';
|
||||||
|
|
||||||
import StudentModeQuiz from '../../../components/StudentModeQuiz/StudentModeQuiz';
|
import StudentModeQuiz from '../../../components/StudentModeQuiz/StudentModeQuiz';
|
||||||
import TeacherModeQuiz from '../../../components/TeacherModeQuiz/TeacherModeQuiz';
|
import TeacherModeQuiz from '../../../components/TeacherModeQuiz/TeacherModeQuiz';
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import webSocketService, { AnswerReceptionFromBackendType } from '../../../servi
|
||||||
import { QuizType } from '../../../Types/QuizType';
|
import { QuizType } from '../../../Types/QuizType';
|
||||||
|
|
||||||
import './manageRoom.css';
|
import './manageRoom.css';
|
||||||
import { ENV_VARIABLES } from '../../../constants';
|
import { ENV_VARIABLES } from 'src/constants';
|
||||||
import { StudentType, Answer } from '../../../Types/StudentType';
|
import { StudentType, Answer } from '../../../Types/StudentType';
|
||||||
import { Button } from '@mui/material';
|
import { Button } from '@mui/material';
|
||||||
import LoadingCircle from '../../../components/LoadingCircle/LoadingCircle';
|
import LoadingCircle from '../../../components/LoadingCircle/LoadingCircle';
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import axios, { AxiosError, AxiosResponse } from 'axios';
|
import axios, { AxiosError, AxiosResponse } from 'axios';
|
||||||
import { ENV_VARIABLES } from '../constants';
|
|
||||||
|
|
||||||
import { QuizType } from '../Types/QuizType';
|
import { FolderType } from 'src/Types/FolderType';
|
||||||
import { FolderType } from '../Types/FolderType';
|
import { QuizType } from 'src/Types/QuizType';
|
||||||
|
import { ENV_VARIABLES } from 'src/constants';
|
||||||
|
|
||||||
class ApiService {
|
class ApiService {
|
||||||
private BASE_URL: string;
|
private BASE_URL: string;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue