- [ ]
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 mockCreateRequests from '../../testing/mockCreateRequests'; | |
| // mocking | |
| jest.mock('../../cms/hooks/useCreateRequests', () => () => mockCreateRequests); | |
| // and then | |
| it('foo', () => { | |
| const error = new APIErrorDummy().create(400, PlayitemAPIError.Create.LayoutIdRequired); | |
| mockCreateRequests.createRequests.mockImplementation(() => Promise.reject(error)); |
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
| it('payload 에 callback 파라미터를 넣으면 완료 후 해당 callback 을 실행한다.', (done) => { | |
| apiResult = new ScreenDummy().create(); | |
| fetchMock.mockResponseOnce(JSON.stringify(apiResult)); | |
| const callback = jest.fn(); | |
| action = FetchActions.getOne('foo', 1, callback); | |
| expectSaga(fetchSaga) | |
| .withReducer(reducer, state) | |
| .dispatch(action) | |
| .put(MiscActions.setLoading(true)) |
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
| #!/bin/bash | |
| set -e | |
| GVERSION="1.10.1" | |
| GFILE="go$GVERSION.linux-amd64.tar.gz" | |
| GOPATH="$HOME/go" | |
| GOROOT="/usr/local/go" | |
| if [ -d $GOROOT ]; then | |
| echo "Installation directories already exist $GOROOT" |