JSFiddle - React, Tailwind, and code Playground
JavaScript
'use strict';
var testHelpers = require('./test-helpers');
var expect = testHelpers.expect;
describe("require('./user-roles')", function() {
var UserRoles;
var CrowdControl = testHelpers.rewire('./crowdcontrol');
// stub out fs
beforeEach(function() {
UserRoles = testHelpers.rewire('/user-roles');
});
CrowdControl = testHelpers.sinon.stub();
it("should export a function.", function() {
expect(UserRoles).to.be.a('function');
});
describe("new UserRoles()", function() {
var userRoles;
beforeEach(function() {
userRoles = new UserRoles('ccUrl', 'namespace', 'environment', 'ccToken', 'authPath');
});
it("should expose '.get()'.", function() {
expect(UserRoles.get, 'UserRoles.get()').to.be.a('function');
});
describe(".get()", function() {
it("should call a new CrowdControl", function() {
UserRoles.get("a", "namespace", "environment", "ccToken", "authPath");
expect(CrowdControl).to.have.been.called;
});
it("should call a .get() on the new crowd control", function() {
});
});
});
});