我在Traefik-Installation下设置了一个Dockerized Jira-Instance。
这是我的 docker-compose.yml:
version: "2"
services:
software:
image: cptactionhank/atlassian-jira-software:latest
labels:
- "traefik.frontend.rule=Host:jira.domain.com"
- "traefik.port=8080"
- "traefik.enable=true"
- "traefik.frontend.entryPoints=http,https"
Run Code Online (Sandbox Code Playgroud)
我的 Jira-Baseurl 设置为https://jira.domain.com,我也可以使用https. 在我的 traefik 设置中,我在每个请求上都设置了从 http 到 https 的重定向。
我的 traefik.toml 看起来像这样:
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
defaultEntryPoints = ["http", "https"]
Run Code Online (Sandbox Code Playgroud)
这是有效的,但根据某些请求,我收到以下错误:
混合内容:“ https://jira.domain.com/secure/Dashboard.jspa ”页面已通过 HTTPS 加载,但请求了不安全的资源“ http://jira.domain.com/plugins/servlet/gadgets/ ifr?container=atlassian&mi ...ivitystream-gadget%2Fgadgets%2Factivitystream-gadget.xml&libs=auth-refresh'。此请求已被阻止;内容必须通过 HTTPS 提供。
我已经读到我必须设置我的代理,但我不知道如何做到这一点。
我目前正在进行一项测试,需要模拟默认导出的配置对象来测试不同的配置可能性。
我发现可以在文件的基础上执行此操作,fetch.mock但这并不能让我在每次测试运行中更改模拟。
是否有类似jest.mockImplementation模拟对象的东西或者它是如何工作的?
我使用示例代码创建了一个存储库:此处
被测单元:
import * as React from "react";
import config from "./config";
export default function App() {
return (
<div className="App">
{config.greet ? <h1>Hello user</h1> : <h1>Bye user</h1>}
</div>
);
}
Run Code Online (Sandbox Code Playgroud)
应该被嘲笑的配置:
const config = { greet: true };
export default config;
Run Code Online (Sandbox Code Playgroud)
我想测试什么
import App from "./App";
import React from "react";
import { render } from "@testing-library/react";
/*
I'm currently only able to mock on per file level but not on test …Run Code Online (Sandbox Code Playgroud)