Skip to content

Commit

Permalink
feat: better error messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
helloanoop committed Jan 29, 2023
1 parent c328281 commit 2e32423
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
1 change: 0 additions & 1 deletion packages/bruno-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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">
&#x2714;&nbsp; {result.description}
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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';
Expand Down Expand Up @@ -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!');
});
});
};
Expand Down
4 changes: 0 additions & 4 deletions packages/bruno-app/src/utils/collections/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 '';
Expand Down
3 changes: 3 additions & 0 deletions packages/bruno-js/src/scripts/test-results.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
const {nanoid} = require('nanoid');

class TestResults {
constructor() {
this.results = [];
}

addResult(result) {
result.uid = nanoid();
this.results.push(result);
}

Expand Down

0 comments on commit 2e32423

Please sign in to comment.