Skip to content

Commit

Permalink
test: enable mocked responses from core when running 'npm run dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamNowotny committed Aug 30, 2024
1 parent 9f7c095 commit 0e018d7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/common/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import {
CIPipelineList,
} from 'common/types';

let TEST = false;
// replaced by Vite
const TEST: boolean = import.meta.env.DEV;

const init = function ({ test = false }) {
TEST = test;
const init = function () {
if (TEST) {
activeProjects.onNext(testActiveProjects);
configurations.onNext(testConfigurations);
Expand Down
4 changes: 2 additions & 2 deletions src/dashboard/dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import 'bootstrap/dist/css/bootstrap.css';
import PageContext from 'common/components/pageContext';
import core from 'common/core';
import logger from 'common/logger';
import PageContext from 'common/components/pageContext';
import 'font-awesome/scss/font-awesome.scss';
import * as React from 'react';
import { createRoot } from 'react-dom/client';
import DashboardTheme from './components/dashboardTheme';
import './dashboard.css';

core.init({ test: false });
core.init();
logger.init({ prefix: 'dashboard', debug: false });

const container = document.getElementById('app');
Expand Down
4 changes: 2 additions & 2 deletions src/dashboard/popup.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import 'bootstrap/dist/css/bootstrap.css';
import PageContext from 'common/components/pageContext';
import core from 'common/core';
import logger from 'common/logger';
import PageContext from 'common/components/pageContext';
import 'font-awesome/scss/font-awesome.scss';
import * as React from 'react';
import { createRoot } from 'react-dom/client';
import DashboardTheme from './components/dashboardTheme';
import './popup.css';

core.init({ test: false });
core.init();
logger.init({ prefix: 'popup', debug: true });

const container = document.getElementById('app');
Expand Down
2 changes: 1 addition & 1 deletion src/options/options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import NotificationsPage from './pages/notificationsPage';
import ServicePage from './pages/service/servicePage';
import ViewPage from './pages/viewPage';

core.init({ test: false });
core.init();
logger.init({ prefix: 'options', debug: false });

const container = document.getElementById('app');
Expand Down

0 comments on commit 0e018d7

Please sign in to comment.