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
test('returns a genuine token when credentials are set', async () => { | |
const { | |
clientId, | |
clientSecret, | |
endpoint, | |
staffEmail: username, | |
staffPassword: password | |
} = secrets; | |
const oauthUrl = `${endpoint}/oauth/token`; |
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 React from 'react'; | |
import styled, { css } from 'styled-components'; | |
export const getFontSize = ({ level }) => `${0.5 + (1 / level)}rem`; | |
const styles = css` | |
font-family: ${(props) => props.theme.fonts.primary}; | |
font-weight: 500; | |
font-size: ${getFontSize}; | |
`; |
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
// This doesn't work | |
// I'd like to figure out why it doesn't. | |
// I get the following error: | |
// Heading(...): A valid React element (or null) must be returned. | |
// You may have returned undefined, an array or some other invalid object. | |
import styled from 'styled-components'; | |
export const getFontSize = ({ level }) => `${0.5 + (1 / level)}rem`; | |
const Heading = ({ level }) => { |
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
--- | |
general: | |
branches: | |
ignore: | |
- gh-pages | |
machine: | |
timezone: Europe/London | |
node: | |
version: 7 |
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 React from 'react'; | |
import { storiesOf } from '@kadira/storybook'; | |
const panelHeadingStyle = { | |
display: 'flex', | |
alignItems: 'center', | |
justifyContent: 'space-between' | |
}; | |
const PanelHeading = ({ children }) => ( | |
<section style={panelHeadingStyle}>{children}</section> |
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
> [email protected] test:custom /Users/aaron/workspace/code/packages/crowdlab-forum | |
> WEBPACK_CONFIG=$(pwd)/webpack.config.test.js BABEL_DISABLE_CACHE=1 NODE_ENV=test ava | |
/Users/aaron/workspace/code/packages/crowdlab-forum/src/templates/media/audio.hbs:1 | |
(function (exports, require, module, __filename, __dirname) { <div class="media-card media-card--forum"> | |
^ | |
SyntaxError: Unexpected token < | |
at Object.exports.runInThisContext (vm.js:78:16) | |
at Module._compile (module.js:543:28) | |
at Module._extensions..js (module.js:580:10) |
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
{ | |
... | |
{ | |
test: /\.module\.scss$/, | |
loader: 'style!css?sourceMap&modules!postcss!sass?sourceMap' | |
}, | |
{ | |
test: /^((?!\.module).)*scss/, | |
loader: 'style!css!sass' | |
}, |
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
Show hidden characters
{ | |
"presets": ["crowdlab"], | |
"env": { | |
"test": { | |
"plugins": [ | |
["babel-plugin-webpack-loaders", { | |
"config": "${WEBPACK_CONFIG_PATH}", | |
"verbose": false | |
}] | |
] |
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
/* @flow */ | |
import R from 'ramda'; | |
import * as ActionTypes from './constants'; | |
import type { State, Action } from '../../types'; | |
import { setGrandchild } from '../../services/reducerHelpers'; | |
const initialState = {}; | |
/* eslint space-infix-ops: "off" */ | |
const comparison = (state: State = initialState, action: Action): State => { |
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
test('binary search returns true if the value exists in middle', t => { | |
const list = [1, 2, 3, 4, 5, 6, 7]; | |
const target = 4; | |
t.is(binarySearch(list, target), 4); | |
}); | |
test('binary search returns true if the value exists in upper half', t => { | |
const list = [1, 2, 3, 4, 5, 6, 7]; | |
const target = 6; |