This file contains 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
# During development of a node module (CLI) using babel to transpile ES6 code i ran in to the following problem | |
# EXAMPLE my-awsome-module | |
npm link | |
my-awsome-module # => Works as expected | |
# do some changes to my-awsome-module | |
# ...babel transpiles code | |
my-awsome-module # => zsh: permission denied: my-awsome-module |
This file contains 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 request from 'request'; | |
import Speaker from 'speaker'; | |
import lame from 'lame'; | |
const speaker = new Speaker({ | |
channels: 2, | |
bitDepth: 16, | |
sampleRate: 44100, | |
mode: lame.STEREO, | |
}); |
This file contains 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
# @https://davidwalsh.name/docker-remove-all-images-containers | |
# Delete every Docker containers | |
# Must be run first because images are attached to containers | |
docker rm -f $(docker ps -a -q) | |
# Delete every Docker image | |
docker rmi -f $(docker images -q) |
This file contains 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
;; SRC: https://www.darkchestnut.com/2016/quicklisp-load-personal-projects-from-arbitrary-locations/ | |
(pushnew (truename "/projects/app/") ql:*local-project-directories* ) | |
(ql:register-local-projects) | |
(ql:quickload :app) |
This file contains 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 * as React from 'react'; | |
export function Box({ customClassName, label }) { | |
return ( | |
<div className={`box ${customClassName}`}> | |
{label} | |
</div> | |
); | |
} |
This file contains 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 * as React from 'react'; | |
import { shallow } from 'enzyme'; | |
import { Box } from './Box'; | |
describe('Tests for Box component', () => { | |
it('should render', () => { | |
const box = shallow(<Box />); | |
expect(box.find('.box').exists()).toEqual(true); | |
}); | |
it('should apply custom class name if provided', () => { |
This file contains 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 * as React from 'react'; | |
import { shallow } from 'enzyme'; | |
import { Box } from './Box'; | |
describe('Tests for Box component', () => { | |
it('should render', () => { | |
const box = shallow(<Box />); | |
expect(box.find('.box')).toExist(); | |
}); | |
it('should apply custom class name if provided', () => { |
This file contains 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
● Tests for Box component › should render | |
Expected "[empty set]" to exist. | |
● Tests for Box component › should apply custom class name if provided | |
Expected <div> to have className of ".custom-red-box" but instead found "box" | |
Found node output: <div className="box" /> | |
This file contains 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
● Tests for Box component › should render | |
expect(received).toEqual(expected) | |
Expected value to equal: | |
true | |
Received: | |
false | |
This file contains 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
yarn add jest-enzyme --dev | |
# OR | |
npm install jest-enzyme --save-dev |
OlderNewer