How to use the replay.fixtures function in replay

To help you get started, we’ve selected a few replay examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github assaf / zombie / test / helpers / index.js View on Github external
// We switch this directory to instrumented code when running code coverage
// report
const Replay    = require('replay');
const Browser   = require('../../src');


Browser.default.silent = true;
// Tests visit example.com, server is localhost port 3003
Browser.localhost('*.example.com', 3003);


// Redirect all HTTP requests to localhost
Replay.fixtures = __dirname + '/../replay';
Replay.networkAccess = true;
Replay.localhost('*.example.com');


module.exports = {
  assert:   require('assert'),
  brains:   require('./brains'),
  Browser:  Browser
};
github assaf / zombie / test / helpers / first.js View on Github external
const Bluebird  = require('bluebird');
const Browser   = require('../../src');
const Path      = require('path');
const Replay    = require('replay');


// Tests visit example.com, server is localhost port 3003
Browser.localhost('*.example.com', 3003);

// Redirect all HTTP requests to localhost
Replay.fixtures = Path.join(__dirname, '/../replay');
Replay.networkAccess = true;
Replay.localhost('*.example.com');

// Long stack traces when running this test suite
Bluebird.longStackTraces();
github tstachl / desk.js / test / job.js View on Github external
var desk = require('../')
  , should = require('should')
  , replay = require('replay')
  ;

replay.fixtures = __dirname + '/fixtures';
replay.mode = 'record';
replay.request_headers = [/^accept/, /^content-type/, /^host/, /^if-/, /^x-/];

try {
  config = require('../config/test');
} catch (err) {
  config = {
    subdomain: 'devel',
    username: 'devel@example.com',
    password: '12345'
  }
}

function createClient() {
  return desk.createClient({
    subdomain: config.subdomain ,
github madshall / node-blink-security / test / index.js View on Github external
before(() => {
    replay.fixtures = './fixtures-failure/';
    debug('replay.fixtures:', replay.fixtures);
    blink = new Blink('', '', {
      _token: process.env.BLINK_AUTH_TOKEN,
      _region_id: process.env.BLINK_REGION_ID,
      _network_id:process.env.BLINK_NETWORK_ID}
    );
    return blink.setupSystem().should.be.rejected;
  });
  after(() => {
github tstachl / desk.js / test / integration_url.js View on Github external
var desk = require('../')
  , should = require('should')
  , replay = require('replay')
  , integrationUrlHref
  ;

replay.fixtures = __dirname + '/fixtures';
replay.mode = 'record';
replay.request_headers = [/^accept/, /^content-type/, /^host/, /^if-/, /^x-/];

try {
  config = require('../config/test');
} catch (err) {
  config = {
    subdomain: 'devel',
    username: 'devel@example.com',
    password: '12345'
  }
}

function createClient() {
  return desk.createClient({
    subdomain: config.subdomain ,
github tstachl / desk.js / test / case.js View on Github external
var desk = require('../')
  , should = require('should')
  , replay = require('replay')
  , caseUrl;

replay.fixtures = __dirname + '/fixtures';
replay.mode = 'record';
replay.request_headers = [/^accept/, /^content-type/, /^host/, /^if-/, /^x-/];

try {
  config = require('../config/test');
} catch (err) {
  config = {
    subdomain: 'devel',
    username: 'devel@example.com',
    password: '12345'
  }
}

function createClient() {
  return desk.createClient({
    subdomain: config.subdomain ,
github tstachl / desk.js / test / macro.js View on Github external
var desk = require('../')
  , should = require('should')
  , replay = require('replay')
  , macroHref
  ;

replay.fixtures = __dirname + '/fixtures';
replay.mode = 'record';
replay.request_headers = [/^accept/, /^content-type/, /^host/, /^if-/, /^x-/];

try {
  config = require('../config/test');
} catch (err) {
  config = {
    subdomain: 'devel',
    username: 'devel@example.com',
    password: '12345'
  }
}

function createClient() {
  return desk.createClient({
    subdomain: config.subdomain ,
github tstachl / desk.js / test / attachment.js View on Github external
var desk = require('../')
  , should = require('should')
  , replay = require('replay')
  , fs = require('fs')
  ;

replay.fixtures = __dirname + '/fixtures';
replay.mode = 'record';
replay.request_headers = [/^accept/, /^content-type/, /^host/, /^if-/, /^x-/];

try {
  config = require('../config/test');
} catch (err) {
  config = {
    subdomain: 'devel',
    username: 'devel@example.com',
    password: '12345'
  }
}

function createClient() {
  return desk.createClient({
    subdomain: config.subdomain ,
github tstachl / desk.js / test / client.js View on Github external
var desk = require('../')
  , should = require('should')
  , replay = require('replay')
  , caseUrl;

replay.fixtures = __dirname + '/fixtures';
replay.mode = 'record';
replay.request_headers = [/^accept/, /^content-type/, /^host/, /^if-/, /^x-/];

try {
  config = require('../config');
} catch (err) {
  config = {
    subdomain: 'devel',
    username: 'devel@example.com',
    password: '12345',
    consumerKey: 'your-consumer-key',
    consumerSecret: 'your-consumer-secret',
    token: 'your-token',
    tokenSecret: 'your-token-secret'
  }
}
github tstachl / desk.js / test / article.js View on Github external
var desk = require('../')
  , should = require('should')
  , replay = require('replay')
  , articleHref
  ;

replay.fixtures = __dirname + '/fixtures';
replay.mode = 'record';
replay.request_headers = [/^accept/, /^content-type/, /^host/, /^if-/, /^x-/];

try {
  config = require('../config/test');
} catch (err) {
  config = {
    subdomain: 'devel',
    username: 'devel@example.com',
    password: '12345'
  }
}

function createClient() {
  return desk.createClient({
    subdomain: config.subdomain ,

replay

When API testing slows you down: record and replay HTTP responses like a boss

MIT
Latest version published 6 years ago

Package Health Score

56 / 100
Full package analysis