Skip to content

Instantly share code, notes, and snippets.

@AshCoolman
AshCoolman / jest.md
Created January 25, 2018 11:05 — forked from vojty/jest.md
Jest cheat sheet

Jest cheat shiiiit

Expect

expect.any(constructor) // expect(callback).toBe(expect.any(Function))
expect.assertions(number) // total count of expected assertions, useful for async tests
.not
.resolves
.rejects
.toBe(value)

.toHaveBeenCalled()

@AshCoolman
AshCoolman / portable-node.md
Created February 8, 2017 05:10 — forked from domenic/portable-node.md
Tips for Writing Portable Node.js Code

Node.js core does its best to treat every platform equally. Even if most Node developers use OS X day to day, some use Windows, and most everyone deploys to Linux or Solaris. So it's important to keep your code portable between platforms, whether you're writing a library or an application.

Predictably, most cross-platform issues come from Windows. Things just work differently there! But if you're careful, and follow some simple best practices, your code can run just as well on Windows systems.

Paths and URLs

On Windows, paths are constructed with backslashes instead of forward slashes. So if you do your directory manipulation

@AshCoolman
AshCoolman / New Mac installation guide.md
Last active July 25, 2018 06:24 — forked from DenisIzmaylov/INSTALLATION.md
Fresh OSX install guide for Node development (El Capitan version)