Skip to content

Instantly share code, notes, and snippets.

export const fetchCoWorkers = async () => {
  const url = 'http://localhost:3001/api/v1/coworkers'
  const response = await fetch(url);
  if (!response.ok) {
    throw new Error('There was an error getting your co-workers.');
  }
  const coWorkers = await response.json();
  return coWorkers
}

Action Creators Tests:

import { setType } from './index'


describe('Action Creators', () => {
    it('setType should return the correct object', () => {
        const returnState = dataThatGoesHere;
        const expected = {

type: 'SET_TYPE',

<html>
<head>
<style type="text/css">
#main { padding: 100px; border: 2px solid pink; }
.blue { background-color: blue; }
</style>
</head>
<body>
<div id="main">Lorem ipsum dolor!</div>
<script type="text/javascript">