mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 15:37:45 +00:00
fix lintings issue and test
This commit is contained in:
parent
fc7455b914
commit
a689cbe0b0
@ -465,7 +465,7 @@ class Commands(RequestHandler):
|
|||||||
if result is None:
|
if result is None:
|
||||||
self.write({"result": ""})
|
self.write({"result": ""})
|
||||||
return
|
return
|
||||||
self.write({ "result": result, "type": type(result).__name__ })
|
self.write({"result": result, "type": type(result).__name__})
|
||||||
|
|
||||||
|
|
||||||
class Events(RequestHandler):
|
class Events(RequestHandler):
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "mitmproxy",
|
"name": "mitmproxy",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"jest": {
|
||||||
|
"verbose": true
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "jest --coverage",
|
"test": "jest --coverage",
|
||||||
"build": "gulp prod",
|
"build": "gulp prod",
|
||||||
@ -31,6 +34,7 @@
|
|||||||
"@types/redux-mock-store": "^1.0.2",
|
"@types/redux-mock-store": "^1.0.2",
|
||||||
"esbuild": "^0.12.9",
|
"esbuild": "^0.12.9",
|
||||||
"esbuild-jest": "^0.5.0",
|
"esbuild-jest": "^0.5.0",
|
||||||
|
"fetch-mock": "^9.11.0",
|
||||||
"gulp": "^4.0.2",
|
"gulp": "^4.0.2",
|
||||||
"gulp-clean-css": "^4.3.0",
|
"gulp-clean-css": "^4.3.0",
|
||||||
"gulp-esbuild": "^0.8.2",
|
"gulp-esbuild": "^0.8.2",
|
||||||
@ -42,6 +46,7 @@
|
|||||||
"gulp-replace": "^1.1.3",
|
"gulp-replace": "^1.1.3",
|
||||||
"gulp-sourcemaps": "^3.0.0",
|
"gulp-sourcemaps": "^3.0.0",
|
||||||
"jest": "^27.0.4",
|
"jest": "^27.0.4",
|
||||||
|
"node-fetch": "^2.6.1",
|
||||||
"through2": "^4.0.2"
|
"through2": "^4.0.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import CommandBar from '../../../components/CommandBar'
|
import CommandBar from '../../../components/CommandBar'
|
||||||
import { render } from "../../test-utils"
|
import { render } from "../../test-utils"
|
||||||
|
import fetchMock from 'fetch-mock';
|
||||||
|
|
||||||
test('CommandBar Component', async () => {
|
test('CommandBar Component', async () => {
|
||||||
|
fetchMock.get('./commands.json', {status: 200})
|
||||||
|
|
||||||
const {asFragment, store} = render(
|
const {asFragment, store} = render(
|
||||||
<CommandBar/>
|
<CommandBar/>
|
||||||
);
|
);
|
||||||
|
@ -1,5 +1,39 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`CommandBar Component 1`] = `
|
||||||
|
<DocumentFragment>
|
||||||
|
<div
|
||||||
|
class="command"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="command-title"
|
||||||
|
>
|
||||||
|
Command Result
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="command-result"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
class="command-input input-group"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="input-group-addon"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
class="fa fa-fw fa-terminal"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<input
|
||||||
|
class="form-control"
|
||||||
|
placeholder="Enter command"
|
||||||
|
type="text"
|
||||||
|
value=""
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</DocumentFragment>
|
||||||
|
`;
|
||||||
|
|
||||||
exports[`CommandBar Component should render correctly 1`] = `
|
exports[`CommandBar Component should render correctly 1`] = `
|
||||||
Array [
|
Array [
|
||||||
<div
|
<div
|
||||||
|
Loading…
Reference in New Issue
Block a user