Skip to content

Instantly share code, notes, and snippets.

@cmonacaps
cmonacaps / customer_menu.test.js
Created August 9, 2019 15:02
jest.fn() is weird
// Consider that some application logic defines:
//
// const serviceRequests = {
// getShoppingCart: customerId => makeHttpGetRequest(`/shopping_cart/${customerId}`),
// getOrderHistory: customerId => makeHttpGetRequest(`/order_history/${customerId}`),
// };
//
// const CustomerMenu = ({customerId, requests}) => (<div>...</div>);
//
// and that always supplies 'serviceRequests' as the CustomerMenu 'requests' prop.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cmonacaps
cmonacaps / App.jsx
Last active April 18, 2020 14:36
exception presentation fails when actual error is lost, possibly during threadsjs post-error-to-window
const App = () => (
<Worker>
{props => (
<ErrorBoundary {...props}>
<Juicy>
<ApplicationComponents />
</Juicy>
</ErrorBoundary>
)}
</Worker>
@cmonacaps
cmonacaps / addendum.md
Last active April 23, 2020 19:15
different ways to import, to arrive at "addTwo is not a function" ... also, obviously I should have been mocking `_utils4`

for the entire run, this was true: util.js

const getNextTaskPreviewForUser = (...
const getNextAssignedTaskPreview = ( ...
const addTwo = (x, y) => {
  console.log('real addTwo');
  return x + y;
};
[NodeError] The value of "offset" is out of range. It must be >= 0 and <= 610557. Received 610558
at boundsError internal/buffer.js:81
at readUInt8 internal/buffer.js:247
at nextUInt8 exif-parser/lib/bufferstream.js:14 var value = this.buffer.readUInt8(this.offset);
at readExifValue exif-parser/lib/exif.js:5 case 1: return stream.nextUInt8();
at readExifTag exif-parser/lib/exif.js:73 values.push(readExifValue(format, stream));
at readIFDSection exif-parser/lib/exif.js:88 tag = readExifTag(tiffMarker, stream);
at parseTags exif-parser/lib/exif.js:145 readIFDSection(tiffMarker,
declare namespace lafs_gui_signon {
interface UserIdent {
id: number;
}
/** checkUserCredentials
*
* Resolve with a `UserIdent` value if the supplied `username` and `password` are valid
{
"type": "Error",
"exception": {
"message": "Failed step: UpdateDeliveryWindow",
"stackTrace": [
{
"className": "orchestrator.Orchestrator",
"fileName": "Orchestrator.kt",
"lineNumber": 402,
"methodName": "pipeline",
{
"data": [
{
"type": "DispatchPoint",
"id": "-1",
"attributes": {
"updated_at": "2019-07-08T19:00:35.624363Z",
"display_name": "DummyDispatchPoint",
"facility": 1
},
{
"data": {
"relationships": {
"prescription": {
"data": {
"type": "Prescription",
"id": "1331017"
}
}
},
const ax = require('axios')
const f = require('./requesterFunction')
const input = {
type: 'Dish',
id: 'f9abece6-10d6-4f49-8297-ae2fe6e07550',
data: {
name: 'cheese slice',
size: 'yield sign',
price: '5.50'