mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-22 07:53:34 +01:00
feat: better error messaging
This commit is contained in:
parent
c328281f21
commit
2e32423869
@ -47,7 +47,6 @@
|
||||
"react-hot-toast": "^2.4.0",
|
||||
"react-redux": "^7.2.6",
|
||||
"react-tooltip": "^5.5.2",
|
||||
"reckonjs": "^0.1.2",
|
||||
"sass": "^1.46.0",
|
||||
"split-on-first": "^3.0.0",
|
||||
"styled-components": "^5.3.3",
|
||||
|
@ -19,8 +19,8 @@ const TestResults = ({ results }) => {
|
||||
Tests ({results.length}/{results.length}), Passed: {passedTests.length}, Failed: {failedTests.length}
|
||||
</div>
|
||||
<ul className="">
|
||||
{results.map((result, index) => (
|
||||
<li key={index} className="py-1">
|
||||
{results.map((result) => (
|
||||
<li key={result.uid} className="py-1">
|
||||
{result.status === 'pass' ? (
|
||||
<span className="test-success">
|
||||
✔ {result.description}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import path from 'path';
|
||||
import filter from 'lodash/filter';
|
||||
import toast from 'react-hot-toast';
|
||||
import trim from 'lodash/trim';
|
||||
import { uuid } from 'utils/common';
|
||||
import cloneDeep from 'lodash/cloneDeep';
|
||||
@ -17,7 +17,6 @@ import {
|
||||
isItemARequest,
|
||||
isItemAFolder,
|
||||
refreshUidsInItem,
|
||||
interpolateEnvironmentVars
|
||||
} from 'utils/collections';
|
||||
import { collectionSchema, itemSchema, environmentSchema, environmentsSchema } from '@usebruno/schema';
|
||||
import { waitForNextTick } from 'utils/common';
|
||||
@ -131,7 +130,7 @@ export const sendRequest = (item, collectionUid) => (dispatch, getState) => {
|
||||
);
|
||||
console.log('>> sending request failed');
|
||||
console.log(err);
|
||||
reject(err);
|
||||
toast.error(err ? err.message : 'Something went wrong!');
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -11,10 +11,6 @@ import cloneDeep from 'lodash/cloneDeep';
|
||||
import { uuid } from 'utils/common';
|
||||
import path from 'path';
|
||||
|
||||
// although we are not using rekonjs directly
|
||||
// its populating the global string prototype with .reckon method
|
||||
import reckon from 'reckonjs';
|
||||
|
||||
const replaceTabsWithSpaces = (str, numSpaces = 2) => {
|
||||
if (!str || !str.length || !isString(str)) {
|
||||
return '';
|
||||
|
@ -1,9 +1,12 @@
|
||||
const {nanoid} = require('nanoid');
|
||||
|
||||
class TestResults {
|
||||
constructor() {
|
||||
this.results = [];
|
||||
}
|
||||
|
||||
addResult(result) {
|
||||
result.uid = nanoid();
|
||||
this.results.push(result);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user