Skip to content

Instantly share code, notes, and snippets.

View aaronmcadam's full-sized avatar
🎉
Having fun!

Aaron McAdam aaronmcadam

🎉
Having fun!
View GitHub Profile
test('returns a genuine token when credentials are set', async () => {
const {
clientId,
clientSecret,
endpoint,
staffEmail: username,
staffPassword: password
} = secrets;
const oauthUrl = `${endpoint}/oauth/token`;
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 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 }) => {
---
general:
branches:
ignore:
- gh-pages
machine:
timezone: Europe/London
node:
version: 7
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>
> [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)
{
...
{
test: /\.module\.scss$/,
loader: 'style!css?sourceMap&modules!postcss!sass?sourceMap'
},
{
test: /^((?!\.module).)*scss/,
loader: 'style!css!sass'
},
{
"presets": ["crowdlab"],
"env": {
"test": {
"plugins": [
["babel-plugin-webpack-loaders", {
"config": "${WEBPACK_CONFIG_PATH}",
"verbose": false
}]
]
/* @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 => {
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;