Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

classdojo/ewe.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ewe.js (yo͞o) Alt ci

a/b testing for the front-end

Example

var ewe = require("ewe");


//pick the ab test service
ewe.use({
  optimizely: {
    //credentials
  }
});




//create a new AB test case
launchpadTest = ewe.group(accountId).
  test("launchpad").
  control("show hud", showHudV1).
  variant("show hud 2", showHudV2).
  variant("show hud 3", { weight: 3}, showHudV3);


variation = launchpadTest.start().call();


function showHudV1() {
  launchpadTest.complete();
  console.log("ab test 1");
}

function showHudV2() {
  launchpadTest.complete();
  console.log("ab test 2");
}

function showHudV3() {
  
}

API

.use(options)

service to use

group .group(uniqueId)

test group.test(name)

creates a new test case, or returns a given test if it's registered.

  • name - name of the st

test.control(name, value)

the control test

test.variant(name [, options], value)

the test variation

  • options - (optional) the options for the variant
    • weight - weight of the variation

value test.select([variationName])

selects a variation, and returns the given value.

value test.control()

returns the control test

variationName - (optional) the variation to select

test.start

called after the test has failed

test.complete(error, success)

called after error / success

About

a/b testing for the front-end

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published