Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"presets": ["stage-1", "es2015", "react"],
"plugins": ["transform-class-properties"]
"presets": ["env", "react"],
"plugins": ["transform-class-properties"],
"env": {
"production": {
"plugins": ["babel-plugin-add-module-exports"]
}
}
}
23 changes: 23 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: 2
jobs:
build:
docker:
- image: circleci/node:8-browsers

steps:
- checkout

- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: yarn install

- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "yarn.lock" }}

- run: yarn test
1 change: 0 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"rules": {
"camelcase": 0,
"no-sequences": 0,
"no-extra-parens": 2,
"no-loop-func": 2,
"require-yield": 2
}
Expand Down
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ lib-cov
# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

Expand All @@ -26,6 +23,7 @@ build/Release
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

run-browserstack-tests.sh
lib

bundle.js
# We use yarn
package-lock.json
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore every folder except lib
./*
!lib
50 changes: 11 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# A/B Testing React Components

[![NPM Version](https://badge.fury.io/js/react-ab-test.svg)](https://www.npmjs.com/package/react-ab-test)
[![Circle CI](https://circleci.com/gh/pushtell/react-ab-test.svg?style=shield)](https://circleci.com/gh/pushtell/react-ab-test)
[![Coverage Status](https://coveralls.io/repos/pushtell/react-ab-test/badge.svg?branch=master&service=github)](https://coveralls.io/github/pushtell/react-ab-test?branch=master)
[![Dependency Status](https://david-dm.org/pushtell/react-ab-test.svg)](https://david-dm.org/pushtell/react-ab-test)
[![NPM Downloads](https://img.shields.io/npm/dm/react-ab-test.svg?style=flat)](https://www.npmjs.com/package/react-ab-test)
[![Circle CI](https://circleci.com/gh/marvelapp/react-ab-test.svg?style=shield)](https://circleci.com/gh/marvelapp/react-ab-test)
[![Coverage Status](https://coveralls.io/repos/marvelapp/react-ab-test/badge.svg?branch=master&service=github)](https://coveralls.io/github/marvelapp/react-ab-test?branch=master)
[![Dependency Status](https://david-dm.org/marvelapp/react-ab-test.svg)](https://david-dm.org/marvelapp/react-ab-test)
[![NPM Downloads](https://img.shields.io/npm/dm/react-ab-test.svg?style=flat)](https://www.npmjs.com/package/@marvelapp/react-ab-test)

Wrap components in [`<Variant />`](#variant-) and nest in [`<Experiment />`](#experiment-). A variant is chosen randomly and saved to local storage.

Expand All @@ -27,7 +27,7 @@ emitter.addPlayListener(function(experimentName, variantName){
});
```

Please [★ on GitHub](https://github.com/pushtell/react-ab-test)!
Please [★ on GitHub](https://github.com/marvelapp/react-ab-test)!

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
Expand Down Expand Up @@ -71,17 +71,16 @@ Please [★ on GitHub](https://github.com/pushtell/react-ab-test)!
- [`segmentHelper.disable()`](#segmenthelperdisable)
- [How to contribute](#how-to-contribute)
- [Requisites](#requisites)
- [Browser Coverage](#browser-coverage)
- [Running Tests](#running-tests)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Installation

`react-ab-test` is compatible with React 0.14.x and 0.15.x.
`react-ab-test` is compatible with React >=0.14.x

```bash
npm install react-ab-test
yarn install react-ab-test
```

## Usage
Expand Down Expand Up @@ -713,42 +712,15 @@ Before contribuiting you need:

Then you can:
- Apply your changes :sunglasses:
- Build your changes with `npm run build`
- Test your changes with `npm test`
- Lint your changes with `npm run lint`
- Build your changes with `yarn build`
- Test your changes with `yarn test`
- Lint your changes with `yarn lint`
- And finally open the PR! :tada:

### Browser Coverage
[Karma](http://karma-runner.github.io/0.13/index.html) tests are performed on [Browserstack](https://www.browserstack.com/) in the following browsers:

* IE 9, Windows 7
* IE 10, Windows 7
* IE 11, Windows 7
* Opera (latest version), Windows 7
* Firefox (latest version), Windows 7
* Chrome (latest version), Windows 7
* Safari (latest version), OSX Yosemite
* Android Browser (latest version), Google Nexus 7, Android 4.1
* Mobile Safari (latest version), iPhone 6, iOS 8.3

[Mocha](https://mochajs.org/) tests are performed on the latest version of [Node](https://nodejs.org/en/).

Please [let us know](https://github.com/pushtell/react-ab-test/issues/new) if a different configuration should be included here.

### Running Tests

Locally:

```bash

npm test

```

On [Browserstack](https://www.browserstack.com/):

```bash

BROWSERSTACK_USERNAME=YOUR_USERNAME BROWSERSTACK_ACCESS_KEY=YOUR_ACCESS_KEY npm test
yarn test

```
4 changes: 0 additions & 4 deletions circle.yml

This file was deleted.

129 changes: 0 additions & 129 deletions lib/CoreExperiment.js

This file was deleted.

Loading