Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const demo = require('..')
const chai = require('chai')
const assert = chai.assert
const expect = chai.expect
const should = chai.should()
chai.use(require('chai-as-promised'))
const { Map, List } = require('immutable')
let networkId
describe('Democracy linking', () => {
before(async () => {
demo.cleanCompileSync("TestLibrary")
eth = demo.getNetwork('test')
networkId = await eth.net_version()
})
// Expect error thrown from promise
// https://stackoverflow.com/a/45496509
it('throws an error to link without compiling', async () => {
'use strict'
/* global describe it beforeEach afterEach */
const chai = require('chai')
const expect = chai.expect
const mockRequire = require('mock-require')
const sinon = require('sinon')
const sinonChai = require('sinon-chai')
chai.use(sinonChai)
const MockCore = require('./mocks/mock-core')
mockRequire('ilp-core', MockCore)
const Client = require('../src/lib/client')
const PaymentRequest = require('../src/lib/request')
const FAKE_TIME = 0
describe('Client', function () {
describe('constructor', function () {
it('should instantiate an ilp-core client', function () {
const client = new Client({
auth: {
account: 'https://ledger.example/accounts/alice',
password: 'alice'
}
/* eslint-env mocha */
'use strict'
const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)
const isNode = require('detect-node')
const waterfall = require('async/waterfall')
const path = require('path')
const fs = require('fs')
const ipfsClient = require('../src')
const f = require('./utils/factory')
describe('.refs', function () {
this.timeout(80 * 1000)
if (!isNode) { return }
let ipfs
let ipfsd
let folder
import chai from 'chai';
import chaiAsPromised from "chai-as-promised";
import 'regenerator-runtime/runtime';
import SevenBoom from './sevenBoom';
var chaiDateString = require('chai-date-string');
chai.use(chaiAsPromised);
chai.use(chaiDateString);
const expect = chai.expect;
// Most of this tests are taken from the Boom repo
// In order to make sure that you can just replace all Boom with SevenBoom
describe('Seven Boom features', () => {
it('does not use default guid generator and timeThrown if they are not set in option', (done) => {
SevenBoom.init();
const error = SevenBoom.badRequest();
expect(error.output.payload.guid).to.not.exist
expect(error.output.payload.timeThrown).to.not.exist
done();
});
it('uses the default guid generator and timeThrown', (done) => {
const opts = [{
name : 'timeThrown',
let chai = require('chai');
let expect = chai.expect;
let sinon = require('sinon');
let testUtil = require('../../../testUtil.js');
chai.use(require('chai-like'));
chai.use(testUtil.obnizAssert);
describe('obniz.libs.switch', function() {
beforeEach(function(done) {
return testUtil.setupObnizPromise(this, done);
});
afterEach(function(done) {
return testUtil.releaseObnizePromise(this, done);
});
it('onchange', function() {
let stub = sinon.stub();
this.obniz.switch.onchange = stub;
expect(this.obniz).to.be.obniz;
sinon.assert.callCount(stub, 0);
const sinon = require('sinon')
const chai = require('chai')
const sinonChai = require('sinon-chai')
const expect = chai.expect
chai.use(sinonChai)
describe('keyServer', () => {
const serveKeyFiles = require('../../routes/keyServer')
beforeEach(() => {
this.req = { params: { } }
this.res = { sendFile: sinon.spy(), status: sinon.spy() }
this.next = sinon.spy()
})
it('should serve requested file from folder /encryptionkeys', () => {
this.req.params.file = 'test.file'
serveKeyFiles()(this.req, this.res, this.next)
expect(this.res.sendFile).to.have.been.calledWith(sinon.match(/encryptionkeys[/\\]test.file/))
/**
* Export modules to global scope as necessary
* (only for testing)
*/
var chai = require('chai');
global.expect = chai.expect;
global.moquire = require('moquire');
global.sinon = require('sinon');
chai.use(require('sinon-chai'));
'use strict';
const expect = require('chai').expect;
const sinon = require('sinon');
require('chai').use(require('sinon-chai'));
describe('Player.setGroupVolume', () => {
const setGroupVolume = require('../../../../lib/prototypes/Player/setGroupVolume.js');
let players;
let coordinator;
let system;
beforeEach(() => {
coordinator = {
uuid: '123456789',
groupState: {
volume: 22
}
};
players = [{
defineSupportCode(function () {
chai.use(chaiAsPromised);
global.expect = chai.expect;
});
public configure() {
if (this.isConfigured) {
return;
}
chai.config.includeStack = true;
chai.use(require('chai-bignumber')());
chai.use(ChaiAsPromised);
this.isConfigured = true;
}
}