var json = JSON.parse(responseBody);
if (responseCode.code >= 200 && responseCode.code < 300) {
// Variável da coleção
pm.collectionVariables.set("productId", json.data.id);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"module": "commonjs", | |
"target": "ES2016", | |
"rootDir": ".", | |
"outDir": "./dist", | |
"baseUrl": ".", | |
"esModuleInterop": true, | |
"strict": true, | |
"strictPropertyInitialization": false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
{ // for typescript | |
"start": "node dist/server.js", | |
"dev": "ts-node-dev --inspect --transpile-only --ignore node_modules --respawn src/server.ts", | |
"test": "mocha -r ts-node/register src/**/*.spec.ts" | |
}, | |
{ // for javascript | |
"start": "node src/server.js", | |
"dev": "nodemon src/server.js", | |
"test": "mocha -r src/**/*.spec.js" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FRONT_PORT=3000 | |
PORT=3001 | |
DB_USER=user | |
DB_PASS=password | |
DB_NAME=database | |
DB_PORT=3306 | |
MONGO_PORT=27017 | |
REDIS_PORT=6379 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getInitialValue( | |
key: string, | |
defaultValue: any, | |
convertFromString = JSON.parse | |
) { | |
const localStorageValue = localStorage.getItem(key); | |
if (localStorageValue) { | |
try { | |
return convertFromString(localStorageValue); | |
} catch { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const FILTERS_LOGIC = { | |
// Logic to filter | |
}; | |
const recursive = (apiArray, filtersArray) => ( | |
apiArray.reduce((acc, crv) => filteredData(acc, filtersArray), [...apiArray])); | |
const filteredData = (apiArray, filtersArray) => ( | |
apiArray.filter((item) => | |
filtersArray.every((filterObj) => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { createContext } from 'react'; | |
import { render } from '@testing-library/react'; | |
import { Provider } from 'react-redux'; | |
import { applyMiddleware, createStore } from 'redux'; | |
import thunk from 'redux-thunk'; | |
import { Router } from 'react-router'; | |
import { createMemoryHistory } from 'history'; | |
export const renderWithRouter = (component) => { | |
const history = createMemoryHistory(); |